Ignore:
Timestamp:
Feb 4, 2009, 12:55:28 AM (16 years ago)
Author:
[email protected]
Message:

Reviewed by Sam Weinig.

https://bugs.webkit.org/show_bug.cgi?id=23681
Worker tests crash in debug builds if run --singly

The crash happened because worker threads continued running while debug-only static objects
were already being destroyed on main thread.

  • runtime/Structure.cpp: Create static debug-only sets in heap, so that they don't get destroyed.
  • wtf/ThreadingPthreads.cpp: Changed assertions to conventional form.
File:
1 edited

Legend:

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

    r39945 r40608  
    196196void Mutex::lock()
    197197{
    198     if (pthread_mutex_lock(&m_mutex) != 0)
    199         ASSERT(false);
     198    int result = pthread_mutex_lock(&m_mutex);
     199    ASSERT_UNUSED(result, !result);
    200200}
    201201   
     
    206206    if (result == 0)
    207207        return true;
    208     else if (result == EBUSY)
     208    if (result == EBUSY)
    209209        return false;
    210210
    211     ASSERT(false);
     211    ASSERT_NOT_REACHED();
    212212    return false;
    213213}
     
    215215void Mutex::unlock()
    216216{
    217     if (pthread_mutex_unlock(&m_mutex) != 0)
    218         ASSERT(false);
     217    int result = pthread_mutex_unlock(&m_mutex);
     218    ASSERT_UNUSED(result, !result);
    219219}
    220220
     
    231231void ThreadCondition::wait(Mutex& mutex)
    232232{
    233     if (pthread_cond_wait(&m_condition, &mutex.impl()) != 0)
    234         ASSERT(false);
     233    int result = pthread_cond_wait(&m_condition, &mutex.impl());
     234    ASSERT_UNUSED(result, !result);
    235235}
    236236
     
    257257void ThreadCondition::signal()
    258258{
    259     if (pthread_cond_signal(&m_condition) != 0)
    260         ASSERT(false);
     259    int result = pthread_cond_signal(&m_condition);
     260    ASSERT_UNUSED(result, !result);
    261261}
    262262
    263263void ThreadCondition::broadcast()
    264264{
    265     if (pthread_cond_broadcast(&m_condition) != 0)
    266         ASSERT(false);
     265    int result = pthread_cond_broadcast(&m_condition);
     266    ASSERT_UNUSED(result, !result);
    267267}
    268268   
Note: See TracChangeset for help on using the changeset viewer.