Community articleMUGetThreadSafeFlag function
Added by IBM contributorIBM on August 16, 2011
Rate this article 1 starsRate this article 2 starsRate this article 3 starsRate this article 4 starsRate this article 5 stars

No abstract provided.



Description

This function will query the current application to determine whether it is thread safe. This is particularly useful if you are developing an extension, since some applications may not support multi-thread extensions.

Function

r_error MUGetThreadSafeFlag(
   r_boolean *theFlagPtr);


Parameters

Table 1. get thread safe flag parameters
ExpressionTypeDescription
*theFlagPtrr_boolean A pointer to the thread safe flag. A value of OK means the application is thread safe; NOTOK means the application is not thread safe.


Returns

OK on success or an error code on failure.

Example

In the following example, MUGetThreadSafeFlag is used to determine which function should be called, depending on whether the current application is thread safe.
r_error SelectRoutine();
{
r_boolean AppIsThreadSafe;
r_error theError;
      if((theError = MUGetThreadSafeFlag(&AppIsThreadSafe)) != OK)
      {
         fprintf(stderr, "MUGetThreadSafeFlag error %hd./n", error);
         return(NOTOK);
      }
      if (AppIsThreadSafe == OK)
         ThreadSafeRoutine();
      else
         NotThreadSafeRoutine();
}


Parent topic:
Utility functions