summaryrefslogtreecommitdiffstats
path: root/cpukit/posix/src/prwlocktrywrlock.c
diff options
context:
space:
mode:
authorSebastian Huber <sebastian.huber@embedded-brains.de>2017-09-21 15:42:45 +0200
committerSebastian Huber <sebastian.huber@embedded-brains.de>2017-10-05 14:29:02 +0200
commit89fc9345dea5c675f8d93546fa3c723918d3279a (patch)
tree89c32d64f375e1a9bf9d3725b1256aeb7ca46221 /cpukit/posix/src/prwlocktrywrlock.c
parentposix: Implement self-contained POSIX barriers (diff)
downloadrtems-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/prwlocktrywrlock.c')
-rw-r--r--cpukit/posix/src/prwlocktrywrlock.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/cpukit/posix/src/prwlocktrywrlock.c b/cpukit/posix/src/prwlocktrywrlock.c
index 976e7a84ac..ccbeb3114b 100644
--- a/cpukit/posix/src/prwlocktrywrlock.c
+++ b/cpukit/posix/src/prwlocktrywrlock.c
@@ -29,15 +29,12 @@ int pthread_rwlock_trywrlock(
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 );
status = _CORE_RWLock_Seize_for_writing(
&the_rwlock->RWLock,
- _Thread_Executing,
false, /* we are not willing to wait */
&queue_context
);