Skip to content

Commit

Permalink
Add sem_timedwait for unix platforms
Browse files Browse the repository at this point in the history
We can almost implement synchronization mechanisms in pure-rust using
pthread semaphores as the primitive but sem_timedwait is necessary for
implementing timeout-based functions.
  • Loading branch information
jynnantonix committed Aug 18, 2016
1 parent 8312c49 commit e2ac609
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/unix/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -710,6 +710,8 @@ extern {
link_name = "sem_wait$UNIX2003")]
pub fn sem_wait(sem: *mut sem_t) -> ::c_int;
pub fn sem_trywait(sem: *mut sem_t) -> ::c_int;
pub fn sem_timedwait(sem: *mut sem_t,
abstime: *const ::timespec) -> ::c_int;
pub fn sem_post(sem: *mut sem_t) -> ::c_int;
pub fn sem_init(sem: *mut sem_t,
pshared: ::c_int,
Expand Down

0 comments on commit e2ac609

Please sign in to comment.