pub unsafe fn new(sem: *mut libc::sem_t, value: u32) -> io::Result<Semaphore> {
        if libc::sem_init(sem, 1, value as libc::c_uint) == 0 {
            Ok(Semaphore(RawSemaphore(sem)))
        } else {
            Err(io::Error::last_os_error())
        }
    }
/// Initializes an unnamed semaphore.
///
/// The semaphore is configured for use by multiple processes.
///
/// Some platforms such as OSX and FreeBSD do not support unnamed
/// semaphores, and this function will always return an error.
///
/// # Safety
///
/// The caller is responsible for ensuring that the memory pointed to by
/// `sem` remains valid for the lifetime of the returned object.
Initializes an unnamed semaphore.
The semaphore is configured for use by multiple processes.

Some platforms such as OSX and FreeBSD do not support unnamed
semaphores, and this function will always return an error.
Initializes an unnamed semaphore . The semaphore is configured for use by multiple processes . Some platforms such as OSX and FreeBSD do not support unnamed semaphores and this function will always return an error .
pub unsafe fn new(sem: *mut libc::sem_t, value: u32) -> io::Result<Semaphore> {
        if libc::sem_init(sem, 1, value as libc::c_uint) == 0 {
            Ok(Semaphore(RawSemaphore(sem)))
        } else {
            Err(io::Error::last_os_error())
        }
    }
pub unsafe fn new ( sem : * mut libc :: sem_t , value : u32 ) -> io :: Result < Semaphore > { if libc :: sem_init ( sem , 1 , value as libc :: c_uint ) == 0 { Ok ( Semaphore ( RawSemaphore ( sem ) ) ) } else { Err ( io :: Error :: last_os_error ( ) ) } }
Initializes an unnamed semaphore.
Initializes an unnamed semaphore .
sem
*mut libc::sem_t
value
u32
safety
The caller is responsible for ensuring that the memory pointed to by
`sem` remains valid for the lifetime of the returned object.
The caller is responsible for ensuring that the memory pointed to by ` sem ` remains valid for the lifetime of the returned object .