Language

The Free and Open Productivity Suite
Released: Apache OpenOffice 4.1.15

API

SDK

Tips ‘n’ Tricks

Miscellaneous


Global Functions in Global Namespace C++
in Sourcefile threadpool.h


uno_bindIdToCurrentThread
extern "C"
sal_Bool uno_bindIdToCurrentThread(
sal_Sequence * pThreadId );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Description
Establishs an association between the current thread and the given thread identifier.
There can be only one association at a time. The association must be broken by
uno_releaseIdFromCurrentThread().
This method is in general called by a bridge, that wants to bind a remote threadId
to a new thread.

Parameters
pThreadId
a byte sequence, that contains the identifier of the current thread.
Return
true, when the identifier was registered. 
        false, when the thread has already an identifier. The identifier was not
        altered. ( This is in general a bug ).

See Also
uno_releaseIdFromCurrentThread()

uno_getIdOfCurrentThread
extern "C"
void uno_getIdOfCurrentThread(
sal_Sequence * * ppThreadId );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Description
Get the identifier of the current thread.
If no id has been bound for the thread before, a new one is generated and bound
to the thread.
For each call to uno_getIdOfCurrentThread(), a call to uno_releaseIdFromCurrentThread()
must be done. 

Parameters
ppThreadId
Contains the (acquired) ThreadId.
See Also
uno_releaseIdFromCurrentThread()

uno_releaseIdFromCurrentThread
extern "C"
void uno_releaseIdFromCurrentThread();

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
If the internal refcount drops to zero, the association betwen threadId and
thread is broken.

uno_threadpool_attach
extern "C"
void uno_threadpool_attach(
uno_ThreadPool hPool );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Description
Makes the current thread known to the threadpool. This function must be
called, BEFORE uno_threadpool_enter() is called and BEFORE a job for this
thread is put into the threadpool (avoid a race between this thread and
an incoming request/reply).
For every call to uno_threadpool_attach, a corrosponding call to
uno_threadpool_detach must be done.

Parameters
hPool
The bridge threadpool handle previously created by uno_threadpool_create.


uno_threadpool_create
extern "C"
uno_ThreadPool uno_threadpool_create();

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Creates a threadpool handle. Typically each remote bridge instances creates one
handle.

uno_threadpool_destroy
extern "C"
void uno_threadpool_destroy(
uno_ThreadPool hPool );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Description
Releases the previously with uno_threadpool_create() created handle.
The handle thus becomes invalid. It is an error to use the handle after
uno_threadpool_destroy().
See Also
uno_threadpool_create()

uno_threadpool_detach
extern "C"
void uno_threadpool_detach(
uno_ThreadPool hPool );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
Detaches the current thread from the threadpool. Must be called for
every call to uno_threadpool_attach.

uno_threadpool_dispose
extern "C"
void uno_threadpool_dispose(
uno_ThreadPool hPool );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
All threads, that are waiting on the hPool handle, are forced out of the pool.
The threads waiting with uno_threadpool_enter() will return with *ppJob == 0

Description
Later calls to uno_threadpool_enter() using the hPool handle will also 
return immeadiatly with *ppJob == 0.

Parameters
hPool
The handle to be disposed.
In case, hPool is 0, this function joins on all threads created
by the threadpool administration. This may e.g. used to ensure, that
no threads are inside the cppu library anymore, in case it needs to get
unloaded.

This function is called i.e. by a bridge, that is forced to dispose itself.

uno_threadpool_enter
extern "C"
void uno_threadpool_enter(
uno_ThreadPool hPool,
void * * ppJob );

virtual abstract const volatile template static inline C-linkage
NO NO NO NO NO NO NO YES

Summary
This method is called to wait for a reply of a previously sent request. This is a
blocking method. uno_threadpool_attach() must have been called before.

Parameters
hPool
the handle that was previously created by uno_threadpool_create().
ppJob
the pointer, that was given by uno_threadpool_putJob
0, when uno_threadpool_dispose() was the reason to fall off from threadpool.
See Also
uno_threadpool_dispose()

Top of Page

Apache Software Foundation

Copyright & License | Privacy | Contact Us | Donate | Thanks

Apache, OpenOffice, OpenOffice.org and the seagull logo are registered trademarks of The Apache Software Foundation. The Apache feather logo is a trademark of The Apache Software Foundation. Other names appearing on the site may be trademarks of their respective owners.