Changeset 40608 in webkit for trunk/JavaScriptCore


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.
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r40562 r40608  
     12009-02-04  Alexey Proskuryakov  <[email protected]>
     2
     3        Reviewed by Sam Weinig.
     4
     5        https://bugs.webkit.org/show_bug.cgi?id=23681
     6        Worker tests crash in debug builds if run --singly
     7
     8        The crash happened because worker threads continued running while debug-only static objects
     9        were already being destroyed on main thread.
     10
     11        * runtime/Structure.cpp: Create static debug-only sets in heap, so that they don't get
     12        destroyed.
     13
     14        * wtf/ThreadingPthreads.cpp: Changed assertions to conventional form.
     15
    1162009-02-03  Gavin Barraclough  <[email protected]>
    217
  • trunk/JavaScriptCore/runtime/Structure.cpp

    r40076 r40608  
    6666
    6767#if ENABLE(JSC_MULTIPLE_THREADS)
    68 static Mutex ignoreSetMutex;
     68static Mutex& ignoreSetMutex = *(new Mutex);
    6969#endif
    7070
    7171static bool shouldIgnoreLeaks;
    72 static HashSet<Structure*> ignoreSet;
     72static HashSet<Structure*>& ignoreSet = *(new HashSet<Structure*>);
    7373#endif
    7474
    7575#if DUMP_STRUCTURE_ID_STATISTICS
    76 static HashSet<Structure*> liveStructureSet;
     76static HashSet<Structure*>& liveStructureSet = *(new HashSet<Structure*>);
    7777#endif
    7878
  • 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.