Ignore:
Timestamp:
Apr 19, 2016, 4:28:03 AM (5 years ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
adbedd1
Parents:
bbe654af
git-author:
Sebastian Huber <sebastian.huber@…> (04/19/16 04:28:03)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/21/16 05:29:39)
Message:

posix: Avoid Giant lock for mutexes

Delete _POSIX_Mutex_Get(). Use _POSIX_Mutex_Get_interrupt_disable()
instead.

Update #2555.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • testsuites/psxtests/psx09/init.c

    rbbe654af r48b04fc3  
    5050}
    5151
     52static void *mutex_lock_task(void *arg)
     53{
     54  pthread_mutex_t *mtx;
     55  int              eno;
     56
     57  mtx = arg;
     58
     59  eno = pthread_mutex_lock( mtx );
     60  rtems_test_assert( eno == 0 );
     61
     62  sched_yield();
     63
     64  eno = pthread_mutex_unlock( mtx );
     65  rtems_test_assert( eno == 0 );
     66
     67  return NULL;
     68}
     69
     70static void test_destroy_locked_mutex(void)
     71{
     72  pthread_mutex_t mtx;
     73  pthread_t       th;
     74  int             eno;
     75
     76  eno = pthread_mutex_init( &mtx, NULL );
     77  rtems_test_assert( eno == 0 );
     78
     79  eno = pthread_create( &th, NULL, mutex_lock_task, &mtx );
     80  rtems_test_assert( eno == 0 );
     81
     82  sched_yield();
     83
     84  eno = pthread_mutex_destroy( &mtx );
     85  rtems_test_assert( eno == EBUSY );
     86
     87  sched_yield();
     88
     89  eno = pthread_mutex_destroy( &mtx );
     90  rtems_test_assert( eno == 0 );
     91
     92  eno = pthread_join( th, NULL );
     93  rtems_test_assert( eno == 0 );
     94}
     95
    5296void *POSIX_Init(
    5397  void *argument
     
    66110  TEST_BEGIN();
    67111
     112  test_destroy_locked_mutex();
     113
    68114  /* set the time of day, and print our buffer in multiple ways */
    69115
Note: See TracChangeset for help on using the changeset viewer.