Description
I'm newer to the traffic server project, when I read the source code, I found this code snippets have not used. in proxy/Main.cc, 1350 line. the code sippnets is like follow:
1347 // This call is required for win_9xMe
1348 //without this this_ethread() is failing when
1349 //start_HttpProxyServer is called from main thread
1350 Thread *main_thread = NEW(new EThread);
1351 main_thread->set_specific();
but I found when eventProcessor.start(num_of_net_threads, stacksize) is execute, in function start of eventProcessor will overwrite the thread specific data which set above, here is the code snippets:
130 EventProcessor::start(int n_event_threads, size_t stacksize)
131 {
132 char thr_name[MAX_THREAD_NAME_LENGTH];
133 int i;
134
135 // do some sanity checking.
136 static int started = 0;
137 ink_release_assert(!started);
138 ink_release_assert(n_event_threads > 0 && n_event_threads <= MAX_EVENT_THREADS);
139 started = 1;
140
141 n_ethreads = n_event_threads;
142 n_thread_groups = 1;
143
144 int first_thread = 1;
145
146 for (i = 0; i < n_event_threads; i++) {
147 EThread *t = NEW(new EThread(REGULAR, i));
148 if (first_thread && !i)
153 all_ethreads[i] = t;
154
155 eventthread[ET_CALL][i] = t;
156 t->set_event_type((EventType) ET_CALL);
157 }
so I think the main_thread should discarded, and make code more clear to read, thank you.