This manual page is for Mac OS X version 10.6.3

If you are running a different version of Mac OS X, view the documentation locally:

  • In Terminal, using the man(1) command

Reading manual pages

Manual pages are intended as a quick reference for people who already understand a technology.

  • For more information about the manual page format, see the manual page for manpages(5).

  • For more information about this technology, look for other documentation in the Apple Reference Library.

  • For general information about writing shell scripts, read Shell Scripting Primer.



XInitThreads(3)                                XLIB FUNCTIONS                                XInitThreads(3)



NAME
       XInitThreads, XLockDisplay, XUnlockDisplay - multi-threading support

SYNTAX
       Status XInitThreads(void);

       void XLockDisplay(Display *display);

       void XUnlockDisplay(Display *display);

ARGUMENTS
       display   Specifies the connection to the X server.

DESCRIPTION
       The XInitThreads function initializes Xlib support for concurrent threads.  This function must be the
       first Xlib function a multi-threaded program calls, and it must complete before any other Xlib call
       is made.  This function returns a nonzero status if initialization was successful; otherwise, it
       returns zero.  On systems that do not support threads, this function always returns zero.

       It is only necessary to call this function if multiple threads might use Xlib concurrently.  If all
       calls to Xlib functions are protected by some other access mechanism (for example, a mutual exclusion
       lock in a toolkit or through explicit client programming), Xlib thread initialization is not
       required.  It is recommended that single-threaded programs not call this function.


       The XLockDisplay function locks out all other threads from using the specified display.  Other
       threads attempting to use the display will block until the display is unlocked by this thread.
       Nested calls to XLockDisplay work correctly; the display will not actually be unlocked until XUnlock-Display XUnlockDisplay
       Display has been called the same number of times as XLockDisplay.  This function has no effect unless
       Xlib was successfully initialized for threads using XInitThreads.

       The XUnlockDisplay function allows other threads to use the specified display again.  Any threads
       that have blocked on the display are allowed to continue.  Nested locking works correctly; if XLock-Display XLockDisplay
       Display has been called multiple times by a thread, then XUnlockDisplay must be called an equal num-ber number
       ber of times before the display is actually unlocked.  This function has no effect unless Xlib was
       successfully initialized for threads using XInitThreads.

SEE ALSO
       Xlib - C Language X Interface



X Version 11                                    libX11 1.2.1                                 XInitThreads(3)

Reporting Problems

The way to report a problem with this manual page depends on the type of problem:

Content errors
Report errors in the content of this documentation with the feedback links below.
Bug reports
Report bugs in the functionality of the described tool or API through Bug Reporter.
Formatting problems
Report formatting mistakes in the online version of these pages with the feedback links below.

Did this document help you? Yes It's good, but... Not helpful...