Changeset 907cfb1 in rtems


Ignore:
Timestamp:
Dec 17, 2013, 11:42:53 PM (5 years ago)
Author:
Till Strauman <strauman@…>
Branches:
4.10
Children:
272a80b7
Parents:
fc48ad8
git-author:
Till Strauman <strauman@…> (12/17/13 23:42:53)
git-committer:
Gedare Bloom <gedare@…> (04/11/14 19:40:16)
Message:

posix: fix race condition between pthread_create and capture engine

Fix PR 2068:
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

    rfc48ad8 r907cfb1  
    199199  the_thread->do_post_task_switch_extension = true;
    200200
     201  _Thread_Disable_dispatch();
     202
    201203  /*
    202204   *  POSIX threads are allocated and started in one operation.
     
    218220     */
    219221    if ( !status ) {
     222      _Thread_Enable_dispatch();
    220223      _POSIX_Threads_Free( the_thread );
    221224      _RTEMS_Unlock_allocator();
     
    231234  }
    232235
     236  _Thread_Enable_dispatch();
     237
    233238  /*
    234239   *  Return the id and indicate we successfully created the thread
Note: See TracChangeset for help on using the changeset viewer.