You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
cthreads_thread_detach does not return 0 upon success for Windows builds of Cthreads, which is contrary to its description stating that it "returns 0 on success, non-zero error code on failure."
cthreads_thread_detach makes a call to CloseHandle, which upon success returns a non-zero value and upon failure returns 0. cthreads_thread_detach simply returns this value without inverting it to match the description.
This is a very simple fix.
Line 73 of cthreads.c should be changed from return CloseHandle(thread.wThread); to return CloseHandle(thread.wThread)==0;