Penguin
Blame: SDL_CreateSemaphore(3)
EditPageHistoryDiffInfoLikePages
Annotated edit history of SDL_CreateSemaphore(3) version 2, including all changes. View license author blame.
Rev Author # Line
2 perry 1 SDL_!CreateSemaphore
2 !!!SDL_!CreateSemaphore
1 perry 3 NAME
4 SYNOPSIS
5 DESCRIPTION
6 RETURN VALUE
7 EXAMPLES
8 SEE ALSO
9 ----
10 !!NAME
11
12
2 perry 13 SDL_!CreateSemaphore- Creates a new semaphore and assigns an initial value to it.
1 perry 14 !!SYNOPSIS
15
16
17 __#include
18 __
19
20
2 perry 21 __SDL_sem *SDL_!CreateSemaphore__(__Uint32
1 perry 22 initial_value__);
23 !!DESCRIPTION
24
25
2 perry 26 __SDL_!CreateSemaphore()__ creates a new semaphore and
1 perry 27 initializes it with the value __initial_value__. Each
2 perry 28 locking operation on the semaphore by ''SDL_!SemWait'',
29 ''SDL_!SemTryWait'' or ''SDL_!SemWaitTimeout'' will
1 perry 30 atomically decrement the semaphore value. The locking
31 operation will be blocked if the semaphore value is not
32 positive (greater than zero). Each unlock operation by
2 perry 33 ''SDL_!SemPost'' will atomically increment the semaphore
1 perry 34 value.
35 !!RETURN VALUE
36
37
38 Returns a pointer to an initialized semaphore or __NULL__
39 if there was an error.
40 !!EXAMPLES
41
42
43 SDL_sem *my_sem;
2 perry 44 my_sem = SDL_!CreateSemaphore(INITIAL_SEM_VALUE);
1 perry 45 if (my_sem == NULL) {
46 return CREATE_SEM_FAILED;
47 }
48 !!SEE ALSO
49
50
2 perry 51 __SDL_!DestroySemaphore__, __SDL_!SemWait__,
52 __SDL_!SemTryWait__, __SDL_!SemWaitTimeout__,
53 __SDL_!SemPost__, __SDL_!SemValue__
1 perry 54 ----
This page is a man page (or other imported legacy content). We are unable to automatically determine the license status of this page.