Determine the thread that owns an Object astThread
"
Object Pointers and Structures"
below. This function attempts to execute even if the global error status is set, but no further error report will be made if it subsequently fails under these circumstances.
This function is only available in the C interface.
This function always returns AST__RUNNING if the AST library has been built without
POSIX thread support (i.e. the "
-with-pthreads"
option was not specified when running
the "
configure"
script).
"
pointer"
is not a real pointer at all -
it is an identifier for a "
handle"
structure, encoded to make it look like a
pointer. Each handle contains (amongst othere things) a "
real"
pointer to
the Object structure. This allows more than one handle to refer to the same
Object structure. So when you call astClone (for instance) you get back an
identifier for a new handle that refers to the same Object as the supplied
handle.
In order to use an Object for anything useful, it must be locked for use by the running thread (either implicitly at creation or explicitly using astLock). The identity of the thread is stored in both the Object structure, and in the handle that was passed to astLock (or returned by the constructor function). Thus it is possible for a thread to have active pointers for Objects that are currently locked by another thread. In general, if such a pointer is passed to an AST function an error will be reported indicating that the Object is currently locked by another thread. The two exceptions to this is that astAnnul can be used to annull such a pointer, and this function can be used to return information about the pointer.
The other practical consequence of this is that when astEnd is called, all active pointers currently owned by the running thread (at the current context level) are annulled. This includes pointers for Objects that are currently locked by other threads.
If the "
ptr"
parameter is zero, then the returned value describes the Object
structure itself. If "
ptr"
is non-zero, then the returned value describes
the supplied Object pointer (i.e. handle), rather than the Object structure.