Changeset a19a7077 in rtems


Ignore:
Timestamp:
Dec 18, 2013, 12:01:11 AM (5 years ago)
Author:
Till Strauman <strauman@…>
Branches:
4.11, master
Children:
4e108d79
Parents:
3096f5c9
git-author:
Till Strauman <strauman@…> (12/18/13 00:01:11)
git-committer:
Gedare Bloom <gedare@…> (01/09/14 15:24:12)
Message:

posix: fix race condition between pthread_create and capture engine

Reproducable crashes occur when using pthreads and the capture engine
at the same time. 'pthread_create()' is the culprit. It creates a SCORE thread
and then calls Thread_Start( ) without disabling thread-dispatching.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • cpukit/posix/src/pthreadcreate.c

    r3096f5c9 ra19a7077  
    197197  api->schedparam  = schedparam;
    198198
     199  _Thread_Disable_dispatch();
     200
    199201  /*
    200202   *  POSIX threads are allocated and started in one operation.
     
    217219     */
    218220    if ( !status ) {
     221      _Thread_Enable_dispatch();
    219222      _POSIX_Threads_Free( the_thread );
    220223      _RTEMS_Unlock_allocator();
     
    230233  }
    231234
     235  _Thread_Enable_dispatch();
     236
    232237  /*
    233238   *  Return the id and indicate we successfully created the thread
Note: See TracChangeset for help on using the changeset viewer.