SDL_SemWait



SDL_SemWait

NAME
SYNOPSIS
DESCRIPTION
RETURN VALUE
EXAMPLES
SEE ALSO

NAME

SDL_SemWait − Lock a semaphore and suspend the thread if the semaphore value is zero.

SYNOPSIS

#include "SDL.h" #include "SDL_thread.h"

int SDL_SemWait(SDL_sem *sem);

DESCRIPTION

SDL_SemWait() suspends the calling thread until either the semaphore pointed to by sem has a positive value, the call is interrupted by a signal or error. If the call is successful it will atomically decrement the semaphore value.

After SDL_SemWait() is successful, the semaphore can be released and its count atomically incremented by a successful call to SDL_SemPost.

RETURN VALUE

Returns 0 if successful or -1 if there was an error (leaving the semaphore unchanged).

EXAMPLES

if (SDL_SemWait(my_sem) == -1) {
        return WAIT_FAILED;
}

...

SDL_SemPost(my_sem);

SEE ALSO

SDL_CreateSemaphore, SDL_DestroySemaphore, SDL_SemTryWait, SDL_SemWaitTimeout, SDL_SemPost, SDL_SemValue



More Linux Commands

manpages/menu_cursor.3menu.html
menu_cursor(3menu) - position a menu's cursor (Man Page)....
menu_cursor.3menu - The function pos_menu_cursor restores the cursor to the current position associated with the menus selected item. This is useful after curse

manpages/gnutls_transport_set_ptr2.3.html
gnutls_transport_set_ptr2(3) - API function - Linux man page
gnutls_transport_set_ptr2.3 - Used to set the first argument of the transport function (for push and pull callbacks). In berkeley style sockets this function wi

manpages/podofotxt2pdf.1.html
podofotxt2pdf(1) convert plain text files into PDF files....
podofotxt2pdf is one of the command line tools from the PoDoFo library that provide several useful operations to work with PDF files. It can convert a plain tex

manpages/XPending.3.html
XPending(3) - handle output buffer or event queue (ManPage)
The XFlush function flushes the output buffer. Most client applications need not use this function because the output buffer is automatically flushed as needed

manpages/putwc.3.html
putwc(3) - write a wide character to a FILE stream (ManPage)
putwc.3 - The fputwc() function is the wide-character equivalent of the fputc(3) function. It writes the wide character wc to stream. If ferror(stream) becomes

manpages/qcatool2.1.html
qcatool2(1) - command line tool for the Qt Cryptographic Arc
qcatool is a command line tool for performing various cryptographic operations with the Qt Cryptographic Architecture (QCA). qcatool can also be used for testin

manpages/pfbtopfa.1.html
pfbtopfa(1) - Convert Postscript .pfb fonts to .pfa format u
This script invokes gs(1) to convert a .pfb file into a .pfa file. SEE ALSO gs(1) VERSION This document was last revised for Ghostscript version 9.15. AUTHOR Ar

manpages/XtDisplayInitialize.3.html
XtDisplayInitialize(3) - initialize, open, or close a displa
The XtDisplayInitialize function builds the resource database, calls the Xlib XrmParseCommand function to parse the command line, and performs other per display

manpages/Mail::SpamAssassin::Plugin::Rule2XSBody.3pm.html
Mail::SpamAssassin::Plugin::Rule2XSBody(3pm) - speed up Spam
This plugin will use native-code object files representing the ruleset, in order to provide significant speedups in rule evaluation. Note that sa-compile must b

manpages/ntfsundelete.8.html
ntfsundelete(8) - recover a deleted file from an NTFS volume
ntfsundelete has three modes of operation: scan, undelete and copy. Scan The default mode, scan simply reads an NTFS Volume and looks for files that have been d

manpages/CPAN::FirstTime.3pm.html
CPAN::FirstTime(3pm) - Utility for CPAN::Config file Initial
The init routine asks a few questions and writes a CPAN/Config.pm or CPAN/MyConfig.pm file (depending on what it is currently using). In the following all quest

manpages/monodis.1.html
monodis(1) - CIL image content dumper and disassembler......
The monodis program is used to dump the contents an ECMA/ISO CIL image (contained in .EXE files that contain extended PE/COFF CIL code). To roundtrip assemblies





We can't live, work or learn in freedom unless the software we use is free.