Repository navigation
LOG: Make sure main thread is getting id=0 - #47
Conversation
|
Test PASSed. |
There was a problem hiding this comment.
line 52 is done not under lock
maybe it is better to split this function into actual init_thread() and get_thread_id() parts?
if get_thread_id function the var "threads_count" can be accessed w/o lock indeed.
There was a problem hiding this comment.
this is a double-checked lock paradigm so no need to take lock every time.
if current thread is not found, it is searched for again with lock held.
it assigns the threads according to the order they are calling this function
calling it on the first time from log_init forces thread 0 to be the main.
|
👍 |
LOG: Make sure main thread is getting id=0
|
There is a gettid() call, why you don't use it |
|
i wanted that the thread numbers will be 0..N-1, and not system-wide identifier |
I think it is useful info to have but it should correspond to some "real" value that is helpful for debug (gdb). |
|
Unfortunately it does not correspond to gdb. |
|
I may ask our debugger guy how the gdb magic works in older gdb versions. |
TEST/APPS/IO_DEMO: Fix the failures when some of multiple servers are killed
No description provided.