diff options
author | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-09-21 15:42:45 +0200 |
---|---|---|
committer | Sebastian Huber <sebastian.huber@embedded-brains.de> | 2017-10-05 14:29:02 +0200 |
commit | 89fc9345dea5c675f8d93546fa3c723918d3279a (patch) | |
tree | 89c32d64f375e1a9bf9d3725b1256aeb7ca46221 /cpukit/posix/src/prwlockwrlock.c | |
parent | posix: Implement self-contained POSIX barriers (diff) | |
download | rtems-89fc9345dea5c675f8d93546fa3c723918d3279a.tar.bz2 |
posix: Implement self-contained POSIX rwlocks
POSIX rwlocks are now available in all configurations and no longer
depend on --enable-posix.
Update #2514.
Update #3115.
Diffstat (limited to 'cpukit/posix/src/prwlockwrlock.c')
-rw-r--r-- | cpukit/posix/src/prwlockwrlock.c | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/cpukit/posix/src/prwlockwrlock.c b/cpukit/posix/src/prwlockwrlock.c index a78554f878..df4d2685aa 100644 --- a/cpukit/posix/src/prwlockwrlock.c +++ b/cpukit/posix/src/prwlockwrlock.c @@ -23,8 +23,6 @@ #include <rtems/posix/rwlockimpl.h> #include <rtems/posix/posixapi.h> -THREAD_QUEUE_OBJECT_ASSERT( POSIX_RWLock_Control, RWLock.Wait_queue ); - int pthread_rwlock_wrlock( pthread_rwlock_t *rwlock ) @@ -33,16 +31,13 @@ int pthread_rwlock_wrlock( Thread_queue_Context queue_context; Status_Control status; - the_rwlock = _POSIX_RWLock_Get( rwlock, &queue_context ); - - if ( the_rwlock == NULL ) { - return EINVAL; - } + the_rwlock = _POSIX_RWLock_Get( rwlock ); + POSIX_RWLOCK_VALIDATE_OBJECT( the_rwlock ); + _Thread_queue_Context_initialize( &queue_context ); _Thread_queue_Context_set_no_timeout( &queue_context ); status = _CORE_RWLock_Seize_for_writing( &the_rwlock->RWLock, - _Thread_Executing, true, /* do not timeout -- wait forever */ &queue_context ); |