Ignore:
Timestamp:
Jan 25, 2010, 3:12:45 PM (15 years ago)
Author:
[email protected]
Message:

Fix Chromium Linux tests: the pthread functions on Linux produce segfault if they receive 0 thread handle.
After r53714, we can have 0 thread handles passed to pthread_join and pthread_detach if corresponding threads
were already terminated and their threadMap entries cleared.
Add a 0 check.

Reviewed by David Levin.

  • wtf/ThreadingPthreads.cpp:

(WTF::waitForThreadCompletion):
(WTF::detachThread):

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/wtf/ThreadingPthreads.cpp

    r53717 r53815  
    208208
    209209    pthread_t pthreadHandle = pthreadHandleForIdentifier(threadID);
     210    if (!pthreadHandle)
     211        return 0;
    210212
    211213    int joinResult = pthread_join(pthreadHandle, result);
     
    221223
    222224    pthread_t pthreadHandle = pthreadHandleForIdentifier(threadID);
     225    if (!pthreadHandle)
     226        return;
    223227
    224228    pthread_detach(pthreadHandle);
Note: See TracChangeset for help on using the changeset viewer.