NPTL Coverage
Open POSIX Test Suite
pthread_atfork/assertions.xml
- The function int pthread_atfork(void (*prepare) (void), void
(*parent) (void), void (*child) (void)) shall declare fork handlers to be
called before and after a fork() command, in the context of the thread
that called the fork(). The 'prepare' fork handler shall be called
before fork() processing commences. The 'parent' fork handle shall be
called after fork() processing completes in the parent process. The
'child' fork shall be called after fork() processing completes in the
child process.
- If no handling is desired at one or more of these three points,
the corresponding fork handler address(es) may be set to NULL.
- Upon successful completion, pthread_atfork() shall return a
value of zero; otherwise an error number shall be returned to indicate
the error: [ENOMEM] - insufficient table space exists to record the fork
handler addresses. The function shall not return an error code of
[EINTR]
pthread_atfork/coverage.txt
This document defines the coverage for the pthread_atfork() function:
Assertion Tested?
1 YES
2 YES
3 YES - *Note: will not test ENOMEM
NOTE:
pthread_attr_destroy/assertions.xml
- The function int pthread_attr_destroy(pthread_attr_t *attr)
destorys a thread attributes object. An implementation may cause
pthread_attr_destroy() to set 'attr' to an implementation-defined invalid
value.
- A destroyed 'attr' attributes object can be reinitialized using
pthread_attr_init(); undefined results referencing the object after it
has been destroyed.
- If success, pthread_attr_destroy() shall return a 0.
pthread_attr_destroy/coverage.txt
This document defines the coverage for the pthread_attr_destroy function:
Assertion Tested?
1 YES *Fails on the implementation of threads that I'm working
on.
2 YES
3 YES
Note: pthread_attr_destroy leaves a lot up to the implementation of threads
that you are testing on. For instance, on the implementation that I'm working
on, pthread_attr_destroy() does nothing.
pthread_attr_getdetachstate/assertions.xml
- The function int pthread_attr_getdetachstate(const
pthread_attr_t *attr, int *detachstate) will get the detachstate
attribute in the 'attr' object. The detach state can be either
PTHREAD_CREATE_DETACHED or PTHEAD_CREATE_JOINABLE.
- If success, it returns 0.
pthread_attr_getdetachstate/coverage.txt
This document defines the coverage for the pthread_attr_getdetachstate function:
Assertion Tested?
1 YES
2 YES
NOTE:
pthread_attr_getschedparam/assertions.xml
- The function int pthread_attr_getschedparam(const pthread_attr_t
*restrict attr, contst struct sched_param *restrict param); gets the
scheduling parameter attributes in the 'attr' argument. The contents of
the 'param' structure are defined in sched.h. For the SCHED_FIFO and
SCHED_RR policies, the only required member of 'param' is
'sched_priority'.
- If success, it returns 0;
pthread_attr_getschedparam/coverage.txt
This document defines the coverage for the pthread_attr_getschedparam function:
Assertion Tested?
1 NO
2 NO
NOTE:
pthread_attr_getschedpolicy/assertions.xml
- The function int pthread_attr_getschedpolicy(const
pthread_attr_t *restrict attr, int *restrict policy); gets the
schedpolicy attribute in the 'attr' argument.
- The supported values of policy will include SCHED_FIFO,
SCHED_RR, and SCHED_OTHER.
- If success, the function returns zero; otherwise, an error
number shall be returned indicating the error.
pthread_attr_getschedpolicy/coverage.txt
This document defines the coverage for the pthread_attr_getschedpolicy function:
Assertion Tested?
1 NO
2 NO
3 NO
Note:
pthread_attr_init/assertions.xml
- The function int pthread_attr_init(pthread_attr_t *attr)
initializes a thread attributes object 'attr' with the default value for
all the individual attributes accorinding to a given implementation.
NOTE: Since most default values are implementation specific, only the
attribute of the detachstate will be tested since the default value is
defined in the spec. (default value: PTHREAD_CREATE_JOINABLE)
- The resulting attributes object (that can also be modified by
setting individual attribute values) when used by pthread_create()
defines the attributes of the thread created.
- A single attributes object can be used in multiple simultaneous
calls to pthread_create(). NOTE: Undefined results occur if
pthread_attr_init() is called specifying an already initialized 'attr'
attributes object.
- If success, pthread_attr_init() returns 0.
- If it fails, an error number will be returned to indicate the
error: [ENOMEM] - Not enough memory to initialize the thread attributes
object. It will not return [EINTR]. NOTE: WON'T test here since it is
more of a stress test, not a conformance test.
pthread_attr_init/coverage.txt
This document defines the coverage for the pthread_attr_init function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
5 NO ** WON'T test since it is more of a stress test rather than
conformance.
Note:
pthread_attr_setdetachstate/assertions.xml
- The function int pthread_attr_setdetachstate(const
pthread_attr_t *attr, int *detachstate) sets the detachstate attribute in
the 'attr' object. The detach state can be either PTHREAD_CREATE_DETACHED
or PTHEAD_CREATE_JOINABLE. A value of PTHREAD_CREATE_DETACHED causes all
threads created with 'attr' to be in a detached state, and using a value
of PTHREAD_CREATE_JOINABLE causes threads created with 'attr' to be in
the joinable state. The default value of the detachstate attribute is
PTHREAD_CREATE_JOINABLE.
- If the thread is created detached, then use of the ID of the
newly created thread by the pthread_detach() or pthread_join() function
will producer an error.
- If success, it returns 0.
- It shall fail if: -[EINVAL] The value of detachstate was
invalid
pthread_attr_setdetachstate/coverage.txt
This document defines the coverage for the pthread_attr_getdetachstate function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
Note:
pthread_attr_setschedparam/assertions.xml
- The function int pthread_attr_setschedparam(pthread_attr_t
*restrict attr, contst struct sched_param *restrict param); sets the
scheduling parameter attributes in the 'attr' argument. The contents of
the 'param' structure are defined in sched.h. For the SCHED_FIFO and
SCHED_RR policies, the only required member of 'param' is
'sched_priority'.
- If success, it returns 0;
- It may return an error number of: -[EINVAL] The value of
'param' is invalid -[ENOTSUP] An attempt to set the attribute to an
unsupported value The function will not return [EINTR]
pthread_attr_setschedparam/coverage.txt
This document defines the coverage for the pthread_attr_setschedparam function:
Assertion Tested?
1 NO
2 NO
3 NO ** Keeping in mind it 'may' fail and not 'shall' fail,
so it will always return PASS, but will return a
PASS and print out a warning if it fails.
Note:
pthread_attr_setschedpolicy/assertions.xml
- The function int pthread_attr_setschedpolicy(pthread_attr_t
*attr, int policy); sets the schedpolicy attribute in the 'attr'
argument.
- The supported values of 'policy' include SCHED_FIFO, SCHED_RR,
and SCHED_OTHER. When threads executing with the scheduling policy are
waiting on a mutex, they shall acquire the mutex in priority order when
the mutex is unlocked.
- If success, it returns zero; otherwise, an error number shall be
returned to indicate the error. The pthread_attr_setschedpolicy()
function may fail if: [EINVAL] The value of policy is invalid. [ENOTSUP]
An attempt to set the attribute to an unsupported value.
pthread_attr_setschedpolicy/coverage.txt
This document defines the coverage for the pthread_attr_setschedpolicy function:
Assertion Tested?
1 YES
2 NO
3 NO ** Keeping in mind it 'may' fail and not 'shall' fail,
so it will always return PASS, but will return a
PASS and print out a warning if it fails.
Note:
pthread_barrierattr_destroy/assertions.xml
- The pthread_barrierattr_destroy( ) function shall destroy a
barrier attributes object. A destroyed attr attributes object can be
reinitialized using pthread_barrierattr_init( );
- The pthread_barrierattr_destroy( ) function may fail if:
[EINVAL] The value specified by attr is invalid. These functions shall
not return an error code of [EINTR].
pthread_barrierattr_destroy/coverage.txt
This document defines the coverage for the pthread_barrierattr_destroy() function:
Assertion Tested?
1 YES
2 YES
Note:
pthread_barrierattr_getpshared/assertions.xml
- The pthread_barrierattr_getpshared( ) function shall obtain the
value of the process-shared attribute from the attributes object
referenced by attr.
- The process-shared attribute is set to PTHREAD_PROCESS_SHARED to
permit a barrier to be operated upon by any thread that has access to the
memory where the barrier is allocated. If the process-shared attribute is
PTHREAD_PROCESS_PRIVATE, the barrier shall only be operated upon by
threads created within the same process as the thread that initialized
the barrier; if threads of different processes attempt to operate on such
a barrier, the behavior is undefined. The default value of the attribute
shall be PTHREAD_PROCESS_PRIVATE. Both constants PTHREAD_PROCESS_SHARED
and PTHREAD_PROCESS_PRIVATE are defined in "pthread.h".
- If successful, the pthread_barrierattr_getpshared( ) function
shall return zero and store the value of the process-shared attribute of
attr into the object referenced by the pshared parameter. Otherwise, an
error number shall be returned to indicate the error.
- These functions may fail if: [EINVAL] The value specified by
attr is invalid. These functions shall not return an error code of
EINTR.
pthread_barrierattr_getpshared/coverage.txt
This document defines the coverage for the pthread_barrierattr_destroy() function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO
NOTE:
pthread_barrierattr_init/assertions.xml
- The pthread_barrierattr_init( ) function shall initialize a
barrier attributes object attr with the default value for all of the
attributes defined by the implementation.
- After a barrier attributes object has been used to initialize
one or more barriers, any function affecting the attributes object
(including destruction) shall not affect any previously initialized
barrier.
- If successful, it shall return zero; otherwise, an error number
shall be returned to indicate the error. The pthread_barrierattr_init( )
function shall fail if: [ENOMEM] Insufficient memory exists to initialize
the barrier attributes object. This function shall not return an error
code of [EINTR].
pthread_barrierattr_init/coverage.txt
This document defines the coverage for the pthread_barrierattr_init() function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_barrierattr_setpshared/assertions.xml
- The pthread_barrierattr_setpshared( ) function shall set the
process-shared attribute in an initialized attributes object referenced
by attr.
- The pthread_barrierattr_setpshared( ) function may fail if:
[EINVAL] The new value specified for the process-shared attribute is not
one of the legal values PTHREAD_PROCESS_SHARED or
PTHREAD_PROCESS_PRIVATE. These functions shall not return an error code
of [EINTR].
- If successful, the pthread_barrierattr_setpshared( ) function
shall return zero; otherwise, an error number shall be returned to
indicate the error.
pthread_barrierattr_setpshared/coverage.txt
This document defines the coverage for the pthread_barrierattr_setpshared() function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_barrier_destroy/assertions.xml
- The pthread_barrier_destroy( ) function shall destroy the
barrier referenced by barrier and release any resources used by the
barrier.
- The pthread_barrier_destroy( ) function may fail if: [EBUSY] The
implementation has detected an attempt to destroy a barrier while it is
in use (for example, while being used in a pthread_barrier_wait( ) call)
by another thread. [EINVAL] The value specified by barrier is
invalid.
- Upon successful completion, these functions shall return zero;
otherwise, an error number shall be returned to indicate the error. These
functions shall not return an error code of EINTR.
pthread_barrier_destroy/coverage.txt
This document defines the coverage for the pthread_barrier_destroy() function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_barrier_init/assertions.xml
- The pthread_barrier_init( ) function shall allocate any
resources required to use the barrier referenced by barrier and shall
initialize the barrier with attributes referenced by attr. If attr is
NULL, the default barrier attributes shall be used; the effect is the
same as passing the address of a default barrier attributes object.
- Upon successful completion, these functions shall return zero;
otherwise, an error number shall be returned to indicate the error.
- The pthread_barrier_init( ) function shall fail if: [EAGAIN] The
system lacks the necessary resources to initialize another barrier.
[EINVAL] The value specified by count is equal to zero. [ENOMEM]
Insufficient memory exists to initialize the barrier.
- The pthread_barrier_init( ) function may fail if: [EBUSY] The
implementation has detected an attempt to reinitialize a barrier while it
is in use (for example, while being used in a pthread_barrier_wait( )
call) by another thread. [EINVAL] The value specified by attr is invalid.
These functions shall not return an error code of [EINTR].
pthread_barrier_init/coverage.txt
This document defines the coverage for the pthread_barrier_init() function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
NOTE:
pthread_barrier_wait/assertions.xml
- The pthread_barrier_wait( ) function shall synchronize
participating threads at the barrier referenced by barrier. The calling
thread shall block until the required number of threads have called
pthread_barrier_wait( ) specifying the barrier.
- When the required number of threads have called
pthread_barrier_wait( ) specifying the barrier, the constant
PTHREAD_BARRIER_SERIAL_THREAD shall be returned to one unspecified thread
and zero shall be returned to each of the remaining threads. At this
point, the barrier shall be reset to the state it had as a result of the
most recent pthread_barrier_init( ) function that referenced it.
- If a signal is delivered to a thread blocked on a barrier, upon
return from the signal handler the thread shall resume waiting at the
barrier if the barrier wait has not completed (that is, if the required
number of threads have not arrived at the barrier during the execution of
the signal handler); otherwise, the thread shall continue as normal from
the completed barrier wait. Until the thread in the signal handler
returns from it, it is unspecified whether other threads may proceed past
the barrier once they have all reached it.
- A thread that has blocked on a barrier shall not prevent any
unblocked thread that is eligible to use the same processing resources
from eventually making forward progress in its execution. Eligibility for
processing resources shall be determined by the scheduling policy.
- Upon successful completion, the pthread_barrier_wait( ) function
shall return PTHREAD_BARRIER_SERIAL_THREAD for a single (arbitrary)
thread synchronized at the barrier and zero for each of the other
threads. Otherwise, an error number shall be returned to indicate the
error.
- The pthread_barrier_wait( ) function may fail if: [EINVAL] The
value specified by barrier does not refer to an initialized barrier
object. These functions shall not return an error code of EINTR.
pthread_barrier_wait/coverage.txt
This document defines the coverage for the pthread_barrier_wait() function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
5 YES
6 YES
NOTE:
pthread_cancel/assertions.xml
- The function int pthread_cancel(pthread_t thread); sends a
request that 'thread' shall be canceled. The target thread's
cancelability state and type determines when/if the cancelation takes
effect.
- When the cancelation request is honored, the cancelation cleanup
handlers for 'thread' are called. When the last cancelation cleanup
handler returns, the thread-specific data destructer functions will be
called for 'thread'. When the last destructer function returns, 'thread'
then terminates. NOTE: Still trying to find a good way to test the second
paragraph of li #2.
- The cancelation processing in the target thread will run
asynchronously with respect to the calling thread returning from
pthread_cancel();
- If success, it returns a 0;
- It may return an error number if: -[ESRCH] No thread could be
found corresponding to that thread ID It will not return [EINTR]
pthread_cancel/coverage.txt
This document defines the coverage for the pthread_cancel function:
Assertion Tested?
1 YES
2 YES ** Difficult to test and assert that date destructors
have been called (read assertions.xml file for more).
3 YES
4 YES
5 YES ** Keeping in mind it 'may' fail and not 'shall' fail,
so it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE: In a lot of these test, I didn't make use of semaphores or mutexes, but
rather manually created my own. This is because I was taking into account
different implementations.
pthread_cleanup_pop/assertions.xml
- The function void pthread_cleanup_pop(int execute); Shall remove
the routine at the top of the calling thread's cancelation cleanup stack
and optionally invoke it (if execute is non-zero).
- It will not return a value, or an error code of [EINTR]
pthread_cleanup_pop/coverage.txt
This document defines the coverage for the pthread_cleanup_pop function:
Assertion Tested?
1 YES
2 YES
NOTE:
pthread_cleanup_push/assertions.xml
- The function void pthread_cleanup_push(void (*routine) (void*),
void *arg); Shall push the specified cancelation cleanup handler routine
onto the calling thread's cancelation cleanup stack. The cancelation
cleanup handler shall be popped from the cancelation cleanup stack and
invoked with the argument arg when: - The thread exits (calls
pthread_exit()) - The thread acts upon a cancelation request - the thread
calls pthread_cleanup_pop() with a non-zero execution argument
- It will not return a value, or an error code of [EINTR]
pthread_cleanup_push/coverage.txt
This document defines the coverage for the pthread_cleanup_push function:
Assertion Tested?
1 YES
2 YES
NOTE:
pthread_condattr_destroy/assertions.xml
- The function int pthread_condattr_destroy(pthread_condattr_t
*attr); shall destroy a condition variable attributes object; the object
becomes, in effect, uninitialized. An implementation may cause
pthread_condattr_destroy() to set the object referenced by attr to an
invalid value.
- A destroyed attr attributes object can be reinitialized using
pthread_condattr_init(); the results of otherwise referencing the object
after it has been destroyed are undefined.
- The pthread_condattr_destroy() function may fail if: [EINVAL]
The value specified by attr is invalid.
pthread_condattr_destroy/coverage.txt
This document defines the coverage for the pthread_condattr_destroy function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES ** Keeping in mind it 'may' fail and not 'shall' fail,
so it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_condattr_getclock/assertions.xml
- The function int pthread_condattr_getclock(pthread_condattr_t
*restrict attr, clockid_t *restrict clock_id); shall get the 'clock'
attribute from an attributes object referenced by 'attr'. It will store
the value of the clock attribute into clock_id and return 0.
- It returns 0 upon success, and an error code if it fails: It may
fail if: [EINVAL] - the 'attr' value is invalid
pthread_condattr_getclock/coverage.txt
This document defines the coverage for the pthread_condattr_getclock function:
Assertion Tested?
1 YES
2 YES
NOTE:
pthread_condattr_getpshared/assertions.xml
- The function int pthread_condattr_getpshared(const
pthread_condattr_t *restrict attr, int *restrict pshared); shall obtain
the value of the process-shared attribute from the attributes object
referenced by attr.
- The default value of the attribute is
PTHREAD_PROCESS_PRIVATE.
- If successful, the pthread_condattr_getpshared() function shall
return zero and store the value of the process-shared attribute of attr
into the object referenced by the pshared parameter. The
pthread_condattr_getpshared() function may fail if: [EINVAL] The value
specified by attr is invalid.
pthread_condattr_getpshared/coverage.txt
This document defines the coverage for the pthread_condattr_getpshared function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_condattr_init/assertions.xml
- The function int pthread_condattr_init(pthread_condattr_t
*attr); shall initialize a condition variable attributes object attr with
the default value for all of the attributes defined by the
implementation.
- After a condition variable attributes object has been used to
initialize one or more condition variables, any function affecting the
attributes object (including destruction) shall not affect any previously
initialized condition variables.
- The pthread_condattr_init() function shall fail if: [ENOMEM]
Insufficient memory exists to initialize the condition variable
attributes object.
pthread_condattr_init/coverage.txt
This document defines the coverage for the pthread_condattr_init function:
Assertion Tested?
1 YES
2 NO *Looking for a way to judge if initialized condition
variables are affected.
3 YES
4 NO * Looking for a way to produce the error conditions
NOTE:
pthread_condattr_setclock/assertions.xml
- The function int pthread_condattr_setclock(pthread_condattr_t
*attr, clockid_t clock_id); shall set the 'clock' attribute in an
initialized attributes object referenced by 'attr'. If it is called with
a clock_id argument that refers to a CPU-time clock, the call shall
fail.
- It returns 0 upon success, and an error code if it fails: It may
fail if: [EINVAL] - the 'attr' value is invalid [EINVAL] - 'clock_id'
doesn't refer to a known clock or is a CPU-time clock.
pthread_condattr_setclock/coverage.txt
This document defines the coverage for the pthread_condattr_setclock function:
Assertion Tested?
1 YES
2 YES
NOTE:
pthread_condattr_setpshared/assertions.xml
- The function int pthread_condattr_setpshared(pthread_condattr_t
*attr, int pshared); shall set the process-shared attribute in an
initialized attributes object referenced by attr. The process-shared
attribute is set to PTHREAD_PROCESS_SHARED to permit a condition variable
to be operated upon by any thread that has access to the memory where the
condition variable is allocated, even if the condition variale is
allocated in memory that is shared by multiple processes. If the
process-shared attribute is set to PTHREAD_PROCESS_PRIVATE, the condition
variable shall only be operated upon by threads create within the same
process as the thread that initialized the condition varible; if threads
of differing processes attempt to operate on such a condition variable,
the behavior is undefined.
- If successful, the pthread_condattr_setpshared() function shall
return zero; The pthread_condattr_setpshared() function may fail if:
[EINVAL] The value specified by attr is invalid. [EINVAL] The new value
specified for the attribute is outside the range of legal values for that
attribute.
pthread_condattr_setpshared/coverage.txt
This document defines the coverage for the pthread_condattr_setpshared function:
Assertion Tested?
1 YES
2 YES
NOTE:
pthread_cond_broadcast/assertions.xml
- The function int pthread_cond_broadcast(pthread_cond_t *cond);
shall unblock all threads currently blocked on the specified condition
variable cond.
- When each thread unblocked as a result of a
pthread_cond_broadcast() returns from its call to pthread_cond_wait() or
pthread_cond_timedwait(), the thread shall own the mutex with which it
called pthread_cond_wait() or pthread_cond_timedwait().
- The pthread_cond_broadcast() functions shall have no effect if
there are no threads currently blocked on cond.
- If successful, the pthread_cond_broadcast() function shall
return zero;
- The pthread_cond_broadcast() function may fail if: [EINVAL] The
value cond does not refer to an initialized condition variable. These
functions shall not return an error code of [EINTR].
pthread_cond_broadcast/coverage.txt
This document defines the coverage for the pthread_cond_broadcast function:
Assertion Tested?
1 YES
2 YES
3 NO
4 YES
5 NO * When it specifies it 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_cond_destroy/assertions.xml
- The function int pthread_cond_destroy(pthread_cond_t *cond);
shall destroy the given condition variable specified by cond; the object
becomes, in effect, uninitialized. An implementation may cause
pthread_cond_destroy() to set the object referenced by cond to an invalid
value. A destroyed condition variable object can be reinitialized using
pthread_cond_init(); the results of otherwise referencing the object
after it has been destroyed are undefined.
- It shall be safe to destroy an initialized condition variable
upon which no threads are currently blocked. Attempting to destroy a
condition variable upon which other threads are currently blocked results
in undefined behavior.
- If successful, the pthread_cond_destroy() function shall return
zero;
- The pthread_cond_destroy() function may fail if: [EBUSY] The
implementation has detected an attempt to destroy the object referenced
by cond while it is referenced (for example, while being used in a
pthread_cond_wait() or pthread_cond_timedwait( )) by another thread.
[EINVAL] The value specified by cond is invalid. The function shall not
return an error code of [EINTR].
pthread_cond_destroy/coverage.txt
This document defines the coverage for the pthread_cond_destroy function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO * When it specifies it 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_cond_init/assertions.xml
- The function int pthread_cond_init(pthread_cond_t *restrict
cond, const pthread_condattr_t *restrict attr); shall initialize the
condition variable referenced by cond with attributes referenced by
attr.If attr is NULL, the default condition variable attributes shall be
used; the effect is the same as passing the address of a default
condition variable attributes object. Upon successful initialization, the
state of the condition variable shall become initialized.
- In cases where default condition variable attributes are
appropriate, the macro PTHREAD_COND_INITIALIZER can be used to initialize
condition variables that are statically allocated. The effect shall be
equivalent to dynamic initialization by a call to pthread_cond_init()
with parameter attr specified as NULL, except that no error checks are
performed.
- If successful, the pthread_cond_init() function shall return
zero;
- The pthread_cond_init() function shall fail if: [EAGAIN] The
system lacked the necessary resources (other than memory) to initialize
another condition variable. [ENOMEM] Insufficient memory exists to
initialize the condition variable. The pthread_cond_init() function may
fail if: [EBUSY] The implementation has detected an attempt to
reinitialize the object referenced by cond, a previously initialized, but
not yet destroyed, condition variable. [EINVAL] The value specified by
attr is invalid. The function shall not return an error code of
[EINTR].
pthread_cond_init/coverage.txt
This document defines the coverage for the pthread_cond_init function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO * Looking for a way to produce the error conditions
* When it specifies it 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_cond_signal/assertions.xml
- The function int pthread_cond_signal(pthread_cond_t *cond);
shall unblock at least one of the threads currently blocked on the
specified condition variable cond.
- When each thread unblocked as a result of a
pthread_cond_signal() returns from its call to pthread_cond_wait() or
pthread_cond_timedwait(), the thread shall own the mutex with which it
called pthread_cond_wait() or pthread_cond_timedwait().
- The pthread_cond_signal() functions shall have no effect if
there are no threads currently blocked on cond.
- If successful, the pthread_cond_signal() function shall return
zero;
- The pthread_cond_signal() function may fail if: [EINVAL] The
value cond does not refer to an initialized condition variable. These
functions shall not return an error code of [EINTR].
pthread_cond_signal/coverage.txt
This document defines the coverage for the pthread_cond_signal function:
Assertion Tested?
1 YES
2 YES
3 NO
4 YES
5 NO * When it specifies it 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_cond_timedwait/assertions.xml
- The function int pthread_cond_timedwait(pthread_cond_t *restrict
cond, pthread_mutex_t *restrict mutex); const struct timespec *restrict
abstime); shall block on a condition variable. It shall be called with
mutex locked by the calling thread or undefined behavior results.
- The pthread_cond_timedwait() function shall be equivalent to
pthread_cond_wait(), except that an error is returned if the absolute
time specified by abstime passes (that is, system time equals or exceeds
abstime) before the condition cond is signaled or broadcasted, or if the
absolute time specified by abstime has already been passed at the time of
the call.
- The pthread_cond_timedwait() function shall fail if: [ETIMEDOUT]
The time specified by 'abstime' has passed. The pthread_cond_timedwait()
function may fail if: [EINVAL] The value specified by cond, mutex,or
abstime is invalid. [EINVAL] Different mutexes were supplied for
concurrent pthread_cond_timedwait() or pthread_cond_wait() operations on
the same condition variable. [EPERM] The mutex was not owned by the
current thread at the time of the call. These functions shall not return
an error code of [EINTR].
pthread_cond_timedwait/coverage.txt
This document defines the coverage for the pthread_cond_timedwait function:
Assertion Tested?
1 YES
2 YES *2-2 and 2-3 seem to pass but hang on nptl 0.36
3 YES
4 YES * When it specifies it 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_cond_wait/assertions.xml
- The function int pthread_cond_wait(pthread_cond_t *restrict
cond, pthread_mutex_t *restrict mutex); shall block on a condition
variable. It shall be called with mutex locked by the calling thread or
undefined behavior results.
- Upon successful return, the mutex shall have been locked and
shall be owned by the calling thread.
- The pthread_cond_wait() function may fail if: [EINVAL] The value
specified by cond, mutex,or abstime is invalid. [EINVAL] Different
mutexes were supplied for concurrent pthread_cond_timedwait() or
pthread_cond_wait() operations on the same condition variable. [EPERM]
The mutex was not owned by the current thread at the time of the call.
These functions shall not return an error code of [EINTR].
pthread_cond_wait/coverage.txt
This document defines the coverage for the pthread_cond_wait function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO * When it specifies it 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_create/assertions.xml
- The int pthread_create(pthread_t *restrict thread, const
pthread_attr_t *restrict attr, void *(*start_routine) (void*), void
*restrict arg); creates a new thread, with attributes specified by
'attr', within a process.
- If 'attr' is NULL, the default attributes shall be used. The
attribute that will be tested is the detached state, because that is the
only state that has a default listed in the specification. default:
PTHREAD_CREATE_JOINABLE Other valid values: PTHREAD_CREATE_DETACHED
- If the attributes specified by 'attr' are modified later after
the thread is create, the thread's attributes should not be affected.
- If success, pthread_create() will store the ID of the the
created thread in the location referenced by 'thread'.
- The thread is created executing 'start_routine' with 'arg' as
its only argument.
- If the 'start_routine' returns, the effect shall be as if there
was an implicit call to pthread_exit() using the return value of
'start_routine' as the exit status. NOTE: that the thread in which main()
was originally invoked is different from this
- When it returns from main(), the effect shall be as if there was
an implicit call to exit() using the return value of main() as the exit
status.
- The signal state of the new thread will be initialized as so: -
The signal mask shall be inherited from the created thread - The set of
signals pending for the new thread shall be empty.
- The floating point environment shall be inherited from the
created thread.
- If pthread_create() fails, no new thread is created and the
contents of the location referenced by 'thread' is undefined.
- if _POSIX_THREAD_CPUTIME is defined, the new thread shall have
a CPU-time clock accessible, and the initial value of this clock shall be
set to 0.
- If success, pthread_create() returns zero.
- If pthread_create() fails, an error number is returned: -
[EAGAIN] The system lacked the resources to create another thread,
or the system-imposed limit on the total number of threads in a process
{PTHREAD_THREADS_MAX} would be exceeded. - [EINVAL] The value
specified by 'attr' is invalid. - [EPERM] The caller does not have
the appropriate permission to set the required scheduling parameters or
scheduling policy.
pthread_create/coverage.txt
This document defines the coverage for the pthread_create function:
Assertion Tested?
1 YES - Also, need to test 'attr' values.
2 YES
3 YES
4 YES
5 YES
6 NO - Skipping.
7 NO - Skipping.
8 YES
9 NO - Skipping. (Floating point environment?)
10 YES - Peculiar behavior of passing the test and then freezing on the
linuxthreads implementation.
11 NO - Skipping TCT tag for now.
12 YES
13 YES
NOTE:
pthread_detach/assertions.xml
- The function int pthread_detach(pthread_t thread); detaches a
thread. It shall indicate to the implementation that storage for 'thread'
can be reclaimed when that thread terminates.
- If 'thread' has not terminated, pthread_detach() won't cause it
to terminate. The effect of multiple pthread_detach() calls on the same
target thread is unspecified.
- If success, it returns 0;
- Upon failure, it returns an error number: -[EINVAL] 'thread'
does not refer to a joinable thread. -[ESRCH] No thread could be found
corresponding to that thread ID It shall not return [EINTR]
pthread_detach/coverage.txt
This document defines the coverage for the pthread_detach function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
NOTE:
pthread_equal/assertions.xml
- The function int pthread_equal(pthread_t t1, pthread_t t2)
compares the thread ids t1 and t2. It returns a non-zero value if t1 and
t2 are equal, othersise it returns zero. No errors are defined.
pthread_equal/coverage.txt
This document defines the coverage for the pthread_equal() function:
Assertion Tested?
1 YES
NOTE:
pthread_exit/assertions.xml
- The function void pthread_exit(void *value_ptr); terminates the
calling thread and makes the value 'value_ptr' available to any
successful join with the terminating thread.
- Any cancelation cleanup handlers that have been pushed and not
yet popped shall be popped and executed in the reverse order that they
were pushed.
- After all cancelation cleanup handlers have been executed, if
the thread has any thread-specific data, appriopriate destructor
functions shall be called in an unspecified order.
- Thread termination does not release any application visible
process resources include, but not limited to, mutexes and file
descriptors, nor does it perform any process-level cleanup actions,
including but not limited to, calling any at exit() routines that may
exist.
- An implicit call to pthread_exit() is made when a thread other
than the thread in which main() was first invoked returns from the start
routine that was used to create it. The function's return value shall
serve as the thread's exit status.
- The process shall exit with an exit status of 0 after the last
thread has been terminated. The behavior shall be as if the
implemenation called exit() with a zero argument at thread termination
time. The pthread_exit() function cannot return to its called.
pthread_exit/coverage.txt
This document defines the coverage for the pthread_exit function:
Assertion Tested?
1 YES
2 YES
3 NO ** Skipping for now.
4 NO ** Skipping for now.
5 NO ** Skipping for now.
6 NO ** Skipping for now.
NOTE:
pthread_getspecific/assertions.xml
- The function void *pthread_getspecific(pthread_key_t key) shall
return the value currently bound to the specified key on behalf of the
calling thread. Calling pthread_getspecific() with a key value not
obtained from pthread_key_create() or after key has been deleted with
pthread_key_delete() is undefined.
- pthread_getspecific can be called from a thread-specific data
destructor function. A call to pthread_getspecific() for the
thread-specific data key being destroyed shall return the value NULL,
unless the value is changed (after the destructor starts) by a call to
pthread_setspecific().
- It shall return the thread-specific data value associated with
the given 'key'. If no thread-specific data value is associated with
'key, then the value NULL shall be returned. It does not return any
errors.
pthread_getspecific/coverage.txt
This document defines the coverage for the pthread_getspecific function:
Assertion Tested?
1 YES
2 NO *Will not test
3 YES
NOTE:
pthread_join/assertions.xml
- The function int pthread_join(pthread_t thread, void
**value_ptr); shall suspend the execution of the calling thread until the
target 'thread' terminates, unless 'thread' has already terminated.
- On return from a successful pthread_join() call with a non-NULL
'value_ptr' argument, the avlue passed to pthread_exit() by the
terminating thread shall be made available in the location referenced by
'value_ptr'.
- When pthread_join() returns successfully, the target thread has
been terminated.
- If the thread calling pthread_join() is canceled, then the
target thread shall not be detached.
- Upon successful completion, it returns 0;
- pthread_join() SHALL fail if: -[EINVAL] The implementation has
detected that the value specified by 'thread' does not refer to a
joinable thread. -[ESRCH] No thread could be found corresponding to that
thread ID pthread_join() MAY fail if: -[EDEADLK] A deadlock was detected
or the value of 'thread' specifies the calling thread. It shall not
return an error code of [EINTR]
pthread_join/coverage.txt
This document defines the coverage for the pthread_join function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO ** Skipping for now.
5 YES
6 YES ** When it specifies 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_key_create/assertions.xml
- The function int pthread_key_create(pthread_key_t *key, void
(*destructor(void*)); shall create a thread-specific data key visible to
all threaads in the process. Key values provided by pthread_key_create()
are opaque objects used to locate thread-specific data. Although the same
key value may be used by different threads, the values bound to the key
by pthread_setspecific() are maintained on a per-thread basis and persist
for the life of the calling thread.
- Upon key creation, the value NULL shall be associated with the
new key in all active threads. Upon thread creation, the value NULL shall
be associated with all defined keys in the new thread.
- An optional destructor function may be associated with each key
value. At thread exit, if a key value has a non-NULL destructor pointer,
and the thread has a non-NULL value associated with that key, the value
of the key is set to NULL, and then the function pointed to is called
with the previously associated value as its sole argument. The order of
destructor calls is unspecified if more than one destructor exists for a
thread when it exits.
- If, after all the destructors have been called for all non-NULL
values with associated destructors, there are still some non-NULL values
with associated destructors, then the process is repeated. If, after at
least (PTHREAD_DESTRUCTOR_ITERATIONS) iterations of destructor calls for
outstanding non-NULL values, there are still some non-NULL values with
associated destructors, implemenations may stop calling destructors or
they may continue calling destructors until no non-NULL values with
associated destructors exist, even though this might result in an
infinite loop.
- If successful, the pthread_key_create() function shall store the
newly created key value at *key and shall return zero. Otherwise, an
error number shall be returned to indicate an error: It shall fail if:
[EAGAIN] - the system lacked the necessary resources to create another
thread_specific data key, or the system imposed limit on the total number
of keys per process [PTHREAD_KEYS_MAX] has been exceeded. [ENOMEM] -
insufficient memory exists to create the key. it shall not return
[EINTR].
pthread_key_create/coverage.txt
This document defines the coverage for the pthread_key_create function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO *Will not test
5 NO *Will not test
NOTE:
pthread_key_delete/assertions.xml
- The function int pthread_key_delete(pthread_key_t key); Shall
delete a thread-specific data key previously returned by
pthread_key_create. The thread-specific data values specified data
values associated with 'key' need not be NULL at the time
pthread_key_delete is called. It is the responsibility of the
application to free any application storage or perform any cleanup
actions for data structures related to the deleted key or associated
thread-specific data in any threads; this cleanup can be done either
before or after pthread_key_delete is called. Any attempt to use 'key'
following the call to pthread_key_delete results in undefined
behavior.
- pthread_key_delete function shall be callable from within
destructor functions. No destructor functions shall be invoked by
pthread_key_delete. Any destructor function that may have been
associated with 'key' shall no longer be called up thread exit.
- If successful, it returns zero. It may fail if: [EINVAL] - The
'key' value is invalid. it shall not return [EINTR]
pthread_key_delete/coverage.txt
This document defines the coverage for the pthread_key_delete function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_kill/assertions.xml
- The pthread_kill() function requests from the kernel to deliver
a specified signal be to a specified thread.
- Just like in the kill() function, error checking shall be
performed but no signal shall actually be sent, if sig is zero.
- The function shall return a value of zero, upon successful
completion.
- The function shall return an error number otherwise.
- No signal shall be sent if the pthread_kill() function
fails.
- [ESRCH] No thread could be found corresponding to that specified
by the given thread ID.
- [EINVAL] The value of the sig argument is an invalid or
unsupported signal number.
- The pthread_kill () function shall not return an error code of
[EINTR].
pthread_kill/coverage.txt
This file defines the coverage for the kill() function testing.
Assertion Status
1 YES
2 YES
3 YES
4 IMPLICITLY tested by assertions 6 and 7.
5 IMPLICITLY tested by assertions 6 and 7.
6 Testing method not yet figured out.
7 YES
8 WON'T test. No way to interrupt the pthread_kill() call.
pthread_mutexattr_destroy/assertions.xml
- The function int pthread_mutexattr_destroy(pthread_mutexattr_t
*attr) destroys a mutex attributes object; the object becomes, in effect,
uninitialized. An implementation may cause pthread_mutexattr_destroy() to
set the object referenced by 'attr' to an invalid value. *NOTE: What the
last sentence states is implementation specific, thus it will not be
covered.
- A destroyed 'attr' attributes object can be reinitialized using
pthread_mutexattr_init(); the results of referencing an 'attr' object
after it has been destroyed are undefined.
- If success, it returns 0.
- An error number may be returned if: [EINVAL] The value
specified by 'attr' is invalid
pthread_mutexattr_destroy/coverage.txt
This document defines the coverage for the pthread_mutexattr_destroy function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES ** Keeping in mind it 'may' fail and not 'shall' fail,
so it will always return PASS, but will return a
PASS and print out a warning if it fails.
Note:
pthread_mutexattr_getpshared/assertions.xml
- The function int pthread_mutexattr_getpshared(const
pthread_mutexattr_t *restrict attr, int *restrict pshared); It shall
obtain the value of the process-shared attribute from 'attr'.
- Upon success, it returns 0, and stores the value of the
process-shared attribute of 'attr' into 'pshared'.
- It MAY fail if: [EINVAL] - 'attr' is invalid.
pthread_mutexattr_getpshared/coverage.txt
This document defines the coverage for the pthread_mutexattr_getpshared function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_mutexattr_gettype/assertions.xml
- The function int pthread_mutexattr_gettype(const
pthread_mutexattr_t *attr, int *restrict type); Gets the mutex 'type'
attribute. This attribute is set in the 'type' parameter to these
functions. The default value is PTHREAD_MUTEX_DEFAULT.
- It returns 0 upon success and stores the value of the type of
the attribute object 'attr' into the reference of the 'type'
parameter.
- It shall fail if: [EINVAL] - The value specified by 'attr' is
invalid.
pthread_mutexattr_gettype/coverage.txt
This document defines the coverage for the pthread_mutexattr_gettype function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_mutexattr_init/assertions.xml
- The function int pthread_mutexattr_init(pthread_mutexattr_t
*attr) initializes a mutex attributes object 'attr' with the default
value for all of the attributes defined by the implementation. Results
are undefined if it is called specifying an already initialized 'attr'
attributes object.
- After a mutex attributes object has been used to initialize one
or more mutexes, any function affecting the attributes object (including
destruction) shall not affect any previously initialized mutexes.
- Upon success it returns 0.
- If it fails, an error number shall be returned: [ENOMEM] -
Insufficient memory exists to initialize the mutex attributes object.
pthread_mutexattr_init/coverage.txt
This document defines the coverage for the pthread_mutexattr_init function:
Assertion Tested?
1 YES
2 NO *Looking for indicators to judge if initialized mutexes
are affected. The prioceiling or protocol attributes may
be relied on, but they belong to REALTIME_THREADS scope,
which is low priority in the schedule.
3 YES
4 NO *Looking for a way to use up the memory without screwing
up the machine.
Note:
pthread_mutexattr_setpshared/assertions.xml
- The function int pthread_mutexattr_setpshared(const
pthread_mutexattr_t *attr, int pshared); It shall set the process-shared
attribute in an initialized attributes object 'attr'. The process-shared
attribute is set to PTHREAD_PROCESS_SHARED to permit a mutex to be
operated upon by any thread that has access to the memory where the mutex
is allocated, even if the mutex is allocated in memory that is shared by
multiple processes. If the process-shared attribute is
PTHREAD_PROCESS_PRIVATE, the mutex shall only be operated upon by threads
created within the same process as the thread that initialized the mutex;
if threads of differing processes attempt to operate on such a mutex, the
behavior is undefined. The default value of the attribute is
PTHREAD_PROCESS_PRIVATE.
- Upon success, it returns 0.
- It MAY fail if: [EINVAL] - 'attr' is invalid. [EINVAL] - the new
value pshared value is outside the range of legal values for that
attribute.
pthread_mutexattr_setpshared/coverage.txt
This document defines the coverage for the pthread_mutexattr_setpshared function:
Assertion Tested?
YES
2 YES
3 YES
NOTE:
pthread_mutexattr_settype/assertions.xml
- The function int pthread_mutexattr_settype(pthread_mutexattr_t
*attr, int type); Sets the mutex 'type' attribute. This attribute is set
in the 'type' parameter to these functions. The default value is
PTHREAD_MUTEX_DEFAULT.
- PTHREAD_MUTEX_NORMAL This type of mutex doesn't detect deadlock.
So a thread attempting to relock this mutex without unlocking it first
will deadllock. Attempting to unlock a mutex locked by a different
thread results in undefined behavior. Attemping to unlock an unlocked
mutex results in undefined behavior.
- PTHREAD_MUTEX_ERRORCHECK Provides errorchecking. A thread
attempting to relock this mutex without unlocking it first will return
with an error. A thread attempting to unlock a mutex which another
thread has locked will return with an error. A thread attempting to
unlock an unlocked mutex will return with an error.
- PTHREAD_MUTEX_RECURSIVE A thread attempting to relock this mutex
without first unlocking it will actually succeed in locking the mutex.
The relocking deadlock which can occur with mutexes of type
PTHREAD_MUTEX_NORMAL cannot occur with this type of mutex. Multiple
locks of this mutex will require the same number of unlocks to release
the mutex before another thread can acquire the mutex. A thread
attempting to unlock a mutex which another thread has locked shall return
with an error. A thread attempting to unlock an unlocked mutex will
return with an error.
- PTHREAD_MUTEX_DEFAULT Attempting to recursively lock a mutex of
this type will result in undefined behavior. Attempting to unlock a mutex
of this type which was not locked by the calling thread results in
undefined behavior. Attempting to unlock a mutex of this type which is
locked results in undefined behavior. An implementation may map this
mutex to one of the other mutex types.
- It returns 0 upon success.
- It shall fail if: [EINVAL] - The value 'type' is invalid. It may
fail if: [EINVAL] - The value specified by 'attr' is invalid. It shall
not return an error code of [EINTR].
pthread_mutexattr_settype/coverage.txt
This document defines the coverage for the pthread_mutexattr_settype function:
Assertion Tested?
1 YES
2 NO **Deadlock occurs (as it should) but the test freezes as
a result. Must find a better way to test.
3 YES
4 NO
5 NO **Will not test because all behavior is undefined.
6 YES
7 YES
NOTE:
pthread_mutex_destroy/assertions.xml
- The function int pthread_mutex_destroy(pthread_mutex_t *mutex);
destroys the mutex referenced by 'mutex'; the mutex object now becomes
becomes uninitialized. An implementation may cause
pthread_mutex_destroy() to set the object referenced by 'mutex' to an
invalid value.
- A destroyed mutex object can be reinitialized using
pthread_mutex_init(); the results of referencing the object after it has
been destroyed are undefined.
- Upon success, it returns a 0;
- pthread_mutex_destroy() may fail if: -[EBUSY] The implementation
has detected an attempt to destory the object referenced by 'mutex' while
it is locked or referenced. -[EINVAL] The value specified by 'mutex' is
invalid. It shall not return [EINTR]
- It shall be safe to destroy an initialized mutex that is
unlocked.
pthread_mutex_destroy/coverage.txt
This document defines the coverage for the pthread_mutex_destroy function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO ** Keeping in mind it 'may' fail and not 'shall' fail,
so it will always return PASS, but will return a
PASS and print out a warning if it fails.
5 YES
NOTE:
pthread_mutex_init/assertions.xml
- The function int pthread_mutex_init(pthread_mutex_t *restrict
mutex, const pthread_mutexattr_t *restrict attr); pthread_mutex_t =
PHTREAD_MUTEX_INITIALIZER initializes a mutex referenced by 'mutex' with
attributes specified by 'attr'. If 'attr' is NULL, the default mutex
attributes are used. The effect shall be the same as passing the address
of a default mutex attributes object.
- Upon successful initialization, the state of the mutex becomes
initialized and unlocked. Attempting to initialize an already intialized
mutex results in undefined behavior.
- In cases where default mutex attributes are appropriate, the
macro PTHREAD_MUTEX_INITIALIZER can be used to intiailize mutexes that
are statically allocated. The effect shall be equivilant to dynamic
intialization by a call to pthread_mutex_init() with paramter 'attr'
specified as NULL, except that no error checks are performed.
- Upon success, it returns a 0;
- It SHALL fail if: -[EAGAIN] The system lacked the neccessary
resources (other than memory) to intialize another mutex. -[ENOMEM]
Insufficient memory exists to initialize the mutex. -[EPERM] The caller
does not have the privilage to perform the operation. It MAY fail if:
-[EBUSY] The implementation has detected an attempt to reinitialize the
object referenced by 'mutex', a previously intialized, but not yet
destroyed, mutex. -[EINVAL] The value specified by 'attr' is invalid. It
shall not return [EINTR]
pthread_mutex_init/coverage.txt
This document defines the coverage for the pthread_mutex_init function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
5 NO * Looking for a way to produce the error conditions
* When it specifies it 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_mutex_lock/assertions.xml
- The function int pthread_mutex_lock(pthread_mutex_t *mutex);
locks the mutex object referenced by 'mutex'. If the mutex is already
locked, the calling thread shall block until the mutex becomes available.
This operation returns with the mutex object referenced by 'mutex' in the
locked state with the calling thread as its owner.
- Upon success, it returns 0.
- Upon failure, it shall return: -[EINVAL] The mutex was created
with the protocol attribute PTHREAD_PRIO_PROTECT and the calling thread's
priority is higher than the mutex's current priority calling. It may fail
if: -[EINVAL] 'mutex' does not refer to an initialized mutex object
-[EDEADLK] The current thread already owns the mutex It shall not return
[EINTR].
pthread_mutex_lock/coverage.txt
This document defines the coverage for the pthread_mutex_lock function:
Assertion Tested?
1 YES
2 YES
3 NO * Error codes are either implementation dependent or
related to the low-priority mutex attributes
* When it specifies 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_mutex_timedlock/assertions.xml
- The function int pthread_mutex_timedlock(pthread_mutex_t
*restrict mutex, const struct timespec *restrict abs_timeout); locks the
mutex object referenced by 'mutex'. If the mutex is already locked, the
calling thread shall block until the mutex becomes available. The wait
will end when the specified timeout time has expired. The timeout expires
when the absolute time 'abs_timeout' passes, or if 'abs_timeout' has
already been passed the time of the call.
- If the Timers option (TMR) is supported, the timeout will be
based on the CLOCK_REALTIME clock. Otherwise, it will be based on the
system clock as returned by time()
- For mutexes initialized with the PRIO_INHERIT protocol, if a
timed mutex wait is terminated because its timeout expired, the priority
of the owner of the mutex shall be adjusted to show the fact that this
thread no longer is among those that are waiting for the mutex.
- Upon success, it returns 0.
- It SHALL fail if: [EINVAL] - The mutex was created with the
protocol attribute of PTHREAD_PRIO_PROTECT and the calling thread's
priority is higher than the mutex's current priority ceiling. [EINVAL] -
The process or thread would have blocked, and the abs_timeout parameter
specified in nano-seconds field value is less than 0 or greater than or
equal to 1,000 million. [ETIMEDOUT] - The timeout expried and the mutex
could not be locked. It MAY fail if: [EVINAL] - 'mutex' does not refer to
an initialized mutex object. [EAGAIN] - (XSI) The mutex could not be
acquired, the max number of recursive locks for 'mutex' has been
exceeded. [EDEADLK] - The current thread already owns the mutex.
pthread_mutex_timedlock/coverage.txt
This document defines the coverage for the pthread_mutex_timedlock function:
Assertion Tested?
1 YES
2 NO
3 NO
4 YES
5 YES
NOTE:
pthread_mutex_trylock/assertions.xml
- The function int pthread_mutex_trylock(pthread_mutex_t *mutex);
is equivalent to pthread_mutex_lock() except that if the mutex object
referenced by 'mutex' is currently locked (by any thread, including the
current thread), the call returns immediately.
- If the mutex type is PTHREAD_MUTEX_RECURSIVE and the mutex is
currently owned by the calling thread, the mutex lock count shall be
incremented by one and the pthread_mutex_trylock() function immediately
returns success.
- It returns 0 if a lock on the mutex object referenced by 'mutex'
is acquired.
- Upon failure, it shall return: -[EINVAL] The mutex was created
with the protocol attribute PTHREAD_PRIO_PROTECT and the calling thread's
priority is higher than the mutex's current priority calling. -[EBUSY]
The mutex could not be acquired because it was already locked. It may
fail if: -[EINVAL] 'mutex' does not refer to an initialized mutex object
It shall not return [EINTR].
pthread_mutex_trylock/coverage.txt
This document defines the coverage for the pthread_mutex_trylock function:
Assertion Tested?
1 YES
2 NO * PTHREAD_MUTEX_RECURSIVE is a new XSI feature, which may not
be available in pthread implementations
3 YES
4 YES * EINVAL and EAGAIN are relevant to low-priority mutex
attributes, which cannot be tested by now
* When it specifies it 'may' fail and not 'shall' fail,
it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_mutex_unlock/assertions.xml
- The function int pthread_mutex_unlock(pthread_mutex_t *mutex);
releases the mutex object 'mutex'.
- If there are threads blocked on the mutex object referenced by
'mutex' when pthread_mutex_unlock() is called, resulting in the mutex
becoming available, the scheduling policy shall determine which thread
shall acquire the mutex.
- Upon success, it returns 0.
- Upon failure, it may return: -[EINVAL] 'mutex' does not refer to
an initialized mutex object -[EPERM] The current thread does not own
'mutex' It shall not return [EINTR].
pthread_mutex_unlock/coverage.txt
This document defines the coverage for the pthread_mutex_unlock function:
Assertion Tested?
1 YES
2 YES * Because the default scheduling policy is implementation
dependent, the case only will only demo the scheduling
sequence instead of testing it.
3 YES
4 NO * The related error codes are all implementation dependent
* Keeping in mind it 'may' fail and not 'shall' fail,
so it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_once/assertions.xml
- The function int pthread_once(pthread_once_t *once_control, void
(*init_routine) (void)); The first call to pthread_once() by any thread
in a process, with a given 'once_control', shall call the 'init_routine'
with no arguments. Subsequent calls of pthread_once() with the same
once_control shall not call the 'init_routine'. The 'once_control'
paramter shall determine whether the associated initialization routine
has been called.
- On return from pthread_once(), 'init_routine' shall have
completed.
- The pthread_once() function is not a cancelation point. But if
'init_routine' is a cancelation point and is canceled, the effect on
'once_control' shall be as if pthread_once() was never called.
- The constant PTHREAD_ONCE_INIT is defined in the pthread.h
header. The behavior of pthread_once() is undefined if 'once_control'
has automatic storage duration or is not initialized by
PTHREAD_ONCE_INIT.
- Upon success, it returns a 0;
- Upon failure, it may return an error number: -[EINVAL] If either
'once_control' or 'init_routine' is invalid It shall not return
[EINTR]
pthread_once/coverage.txt
This document defines the coverage for the pthread_once function:
Assertion Tested?
1 YES
2 NO
3 YES
4 YES
5 NO
6 NO ** Keeping in mind it 'may' fail and not 'shall' fail,
so it will always return PASS, but will return a
PASS and print out a warning if it fails.
NOTE:
pthread_rwlockattr_destroy/assertions.xml
- The function int pthread_rwlockattr_destroy(pthread_rwlockattr_t
*attr) destroys a read write attributes objects.
- A destroyed 'attr' attributes object can be reinitialized using
pthread_rwlockattr_init();
- If success, it returns 0.
- An error number may be returned if: [EINVAL] The value
specified by 'attr' is invalid This function shall not return an error
ecode of [EINTR]
pthread_rwlockattr_destroy/coverage.txt
This document defines the coverage for the pthread_mutexattr_destroy function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO
Note:
pthread_rwlockattr_getpshared/assertions.xml
- The function int pthread_rwlockattr_getpshared(const
pthread_rwlockattr_t *restrict attr, int *restrict pshared); It shall
obtain the value of the process-shared attribute from 'attr'.
- The process-shared attribute shall be set to
PTHREAD_PROCESS_SHARED to permit a read-write lock to be operated upon by
any thread that has access to the memory where the read-write lock is
allocated, even if the read-write lock is allocated in memory that is
shared by multiple processes.
- If the process-shared attribute is PTHREAD_PROCESS_PRIVATE, the
read-write lock shall only be operated upon by threads created within the
same process as the thread that initialized the read-write lock; if
threads of different processes attempt to operate on such a read-write
lock, the behavior is undefined.
- The default value of the process-shared attribute shall be
PTHREAD_PROCESS_PRIVATE.
- Upon success, it returns 0, and stores the value of the
process-shared attribute of 'attr' into 'pshared'.
- It MAY fail if: [EINVAL] - 'attr' is invalid. Shall not return
an error code of [EINTR]
pthread_rwlockattr_getpshared/coverage.txt
This document defines the coverage for the pthread_mutexattr_getpshared function:
Assertion Tested?
1 YES
2 YES
3 NO: since the behavior is "undefined"
4 YES
5 YES
6 NO
NOTE:
pthread_rwlockattr_init/assertions.xml
- pthread_rwlockattr_init( ) function shall initialize a
read-write lock attributes object attr with the default value for all of
the attributes defined by the implementation.
- After a read-write lock attributes object has been used to
initialize one or more read-write locks, any function affecting the
attributes object (including destruction) shall not affect any previously
initialized read-write locks.
- If successful, the pthread_rwlockattr_init( ) functions shall
return zero; otherwise, an error number shall be returned to indicate the
error.
- pthread_rwlockattr_init( ) function shall fail if: [ENOMEM]
Insufficient memory exists to initialize the read-write lock attributes
object. This function shall not return an error code of [EINTR].
pthread_rwlockattr_init/coverage.txt
This document defines the coverage for the pthread_rwlockattr_init function:
Assertion Tested?
1 YES
2 YES
3 YES
4 NO *Looking for a way to use up the memory without screwing
up the machine.
Note:
pthread_rwlockattr_setpshared/assertions.xml
- pthread_rwlockattr_setpshared( ) function shall set the
process-shared attribute in an initialized attributes object referenced
by attr.
- If successful, the pthread_rwlockattr_setpshared( ) function
shall return zero; otherwise, an error number shall be returned to
indicate the error.
- It MAY fail if: [EINVAL] - 'attr' is invalid. Shall not return
an error code of [EINTR]
pthread_rwlockattr_setpshared/coverage.txt
This document defines the coverage for the pthread_rwlockattr_init function:
Assertion Tested?
1 YES
2 YES
3 NO
Note:
pthread_rwlock_destroy/assertions.xml
- pthread_rwlock_destroy( ) function shall destroy the read-write
lock object referenced by rwlock and release any resources used by the
lock.
- If successful, the pthread_rwlock_destroy( ) return zero;
otherwise, an error number shall be returned to indicate the error.
- If not successful, pthread_rwlock_destroy( ) function may fail
if: [EBUSY] The implementation has detected an attempt to destroy the
object referenced by rwlock while it is locked. [EINVAL] The value
specified by rwlock is invalid. Shall not return an error code of
[EINTR]
pthread_rwlock_destroy/coverage.txt
This document defines the coverage for the pthread_rwlock_destroy function:
Assertion Tested?
1 YES
2 YES
3 YES ** Tested EBUSY, but not EINVAL,
NOTE:
pthread_rwlock_init/assertions.xml
- pthread_rwlock_init(pthread_rwlock_t *restrict rwlock, const
pthread_rwlockattr_t *restrict attr); pthread_rwlock_init( ) function
shall allocate any resources required to use the read-write lock
referenced by rwlock and initializes the lock to an unlocked state with
attributes referenced by attr.
- If attr is NULL, the default read-write lock attributes shall be
used; the effect is the same as passing the address of a default
read-write lock attributes object.
- Once initialized, the lock can be used any number of times
without being reinitialized.
- If successful, the pthread_rwlock_init( ) function shall return
zero; otherwise, an error number shall be returned to indicate the
error.
- ptread_rwlock_init( ) function shall fail if: [EAGAIN] The
system lacked the necessary resources (other than memory) to initialize
another read-write lock. [ENOMEM] Insufficient memory exists to
initialize the read-write lock. [EPERM] The caller does not have the
privilege to perform the operation.
- pthread_rwlock_init( ) may fail if: [EBUSY] The implementation
has detected an attempt to reinitialize the object referenced by rwlock,
a previously initialized but not yet destroyed read-write lock. [EINVAL]
The value specified by attr is invalid.
pthread_rwlock_init/coverage.txt
This document defines the coverage for the pthread_rwlock_init() function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
5 NO **Need to find out how to test EGAIN, ENOMEM and EPERM
6 YES *Tested EBUSY, but not EINVAL
NOTE:
pthread_rwlock_rdlock/assertions.xml
- pthread_rwlock_rdlock( ) function shall apply a read lock to the
read-write lock referenced by rwlock. The calling thread acquires the
read lock if a writer does not hold the lock and there are no writers
blocked on the lock.
- If the Thread Execution Scheduling option is supported, and the
threads involved in the lock are executing with the scheduling policies
SCHED_FIFO or SCHED_RR, the calling thread shall not acquire the lock if
a writer holds the lock or if writers of higher or equal priority are
blocked on the lock; otherwise, the calling thread shall acquire the
lock.
- If the Threads Execution Scheduling option is supported, and the
threads involved in the lock are executing with the SCHED_SPORADIC
scheduling policy, the calling thread shall not acquire the lock if a
writer holds the lock or if writers of higher or equal priority are
blocked on the lock; otherwise, the calling thread shall acquire the
lock.
- If a signal is delivered to a thread waiting for a read-write
lock for reading, upon return from the signal handler the thread resumes
waiting for the read-write lock for reading as if it was not
interrupted.
- A thread may hold multiple concurrent read locks on 'rwlock' and
the application shall ensure that the thread will perform matching
unlocks for each read lock.
- If successful, the pthread_rwlock_rdlock( ) function shall
return zero; otherwise, an error number shall be returned to indicate the
error. These functions shall not return an error code of [EINTR].
pthread_rwlock_rdlock/coverage.txt
This document defines the coverage for the pthread_rwlock_rdlock() function:
Assertion Tested?
1 YES
2 YES ** Need support of Threads Execution Scheduling
3 NO: ** Need support of SCHED_SPORADIC
4 YES
5 YES
6 YES
NOTE:
pthread_rwlock_timedrdlock/assertions.xml
- The function shall apply a read lock to the read-write lock
referenced by rwlock as in the pthread_rwlock_rdlock(). However, if the
lock cannot be acquired wither out waiting for other threads to unlock
the lock, this wait shall be terminated when the specified timeout
expires.
- The timeout shall expire when the absolute time specified by
abs_timeout passes, as measured by the clock on which timeouts are based
(that is, when the value of that clock equals or exceeds abs_timeout), or
if the absolute time specified by abs_timeout has already been passed at
the time of the call.
- If the Timers option is supported, the timeout shall be based on
the CLOCK_REALTIME clock.
- If the Timers option is not supported, the timeout shall be
based on the system clock as returned by the time( ) function. The
resolution of the timeout shall be the resolution of the clock on which
it is based. The timespec data type is defined in the 'time.h'
header.
- Under no circumstances shall the function fail with a timeout if
the lock can be acquired immediately. The abs_timeout parameter need not
be checked if the lock can be immediately acquired.
- If a signal that causes a signal handler to be executed is
delivered to a thread blocked on a read-write lock via a call to
pthread_rwlock_timedwrlock( ), upon return from the signal handler the
thread shall resume waiting for the lock as if it was not
interrupted.
- Shall return zero if the lock for writing on the read-write lock
object referenced by rwlock is acquired. Otherwise, an error number shall
be returned to indicate the error pthread_rwlock_timedwrlock( ) function
shall fail if: [ETIMEDOUT] The lock could not be acquired before the
specified timeout expired. The function shall not return an error code of
[EINTR].
pthread_rwlock_timedrdlock/coverage.txt
This document defines the coverage for the pthread_rwlock_timerdlock() function:
Assertion Tested?
1 YES
2 YES
3 NO: Timers option
4 YES
5 YES
6 YES
7 YES
NOTE:
pthread_rwlock_timedwrlock/assertions.xml
- pthread_rwlock_timedwrlock( ) function shall apply a write lock
to the read-write lock referenced by rwlock as in the
pthread_rwlock_wrlock( ) function. However, if the lock cannot be
acquired without waiting for other threads to unlock the lock, this wait
shall be terminate when the specified timeout expires.
- The timeout shall expire when the absolute time specified by
abs_timeout passes, as measured by the clock on which timeouts are based
(that is, when the value of that clock equals or exceeds abs_timeout), or
if the absolute time specified by abs_timeout has already been passed at
the time of the call.
- If the Timers option is supported, the timeout shall be based on
the CLOCK_REALTIME clock.
- If the Timers option is not supported, the timeout shall be
based on the system clock as returned by the time( ) function. The
resolution of the timeout shall be the resolution of the clock on which
it is based. The timespec data type is defined in the header.
- Under no circumstances shall the function fail with a timeout if
the lock can be acquired immediately. The abs_timeout parameter need not
be checked if the lock can be immediately acquired.
- If a signal that causes a signal handler to be executed is
delivered to a thread blocked on a read-write lock via a call to
pthread_rwlock_timedwrlock( ), upon return from the signal handler the
thread shall resume waiting for the lock as if it was not
interrupted.
- Shall return zero if the lock for writing on the read-write lock
object referenced by rwlock is acquired. Otherwise, an error number shall
be returned to indicate the error pthread_rwlock_timedwrlock( ) function
shall fail if: [ETIMEDOUT] The lock could not be acquired before the
specified timeout expired. The function shall not return an error code of
[EINTR].
pthread_rwlock_timedwrlock/coverage.txt
This document defines the coverage for the pthread_rwlock_timedwrlock() function:
Assertion Tested?
1 YES
2 YES
3 NO: Timers option
4 YES
5 YES
6 YES
7 YES
NOTE:
pthread_rwlock_tryrdlock/assertions.xml
- The pthread_rwlock_tryrdlock( ) function shall apply a read lock
as in the pthread_rwlock_rdlock( ) function, with the exception that the
function shall fail if the equivalent pthread_rwlock_rdlock( ) call would
have blocked the calling thread. In no case shall the
pthread_rwlock_tryrdlock( ) function ever block; it always either
acquires the lock or fails and returns immediately.
- The pthread_rwlock_tryrdlock( ) function shall return zero if
the lock for reading on the read-write lock object referenced by rwlock
is acquired. Otherwise, an error number shall be returned to indicate the
error.
- The pthread_rwlock_tryrdlock( ) function shall fail if: [EBUSY]
The read-write lock could not be acquired for reading because a writer
holds the lock or a writer with the appropriate priority was blocked on
it. The function shall not return an error code of [EINTR].
pthread_rwlock_tryrdlock/coverage.txt
This document defines the coverage for the pthread_rwlock_tryrdlock() function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_rwlock_trywrlock/assertions.xml
- pthread_rwlock_trywrlock( ) function shall apply a write lock
like the pthread_rwlock_wrlock( ) function, with the exception that the
function shall fail if any thread currently holds rwlock (for reading or
writing)
- The pthread_rwlock_trywrlock( ) function shall return zero if
the lock for writing on the read-write lock object referenced by rwlock
is acquired. Otherwise, an error number shall be returned to indicate the
error.
- The pthread_rwlock_trywrlock( ) function shall fail if: [EBUSY]
The read-write lock could not be acquired for writing because a writer
holds the lock or a writer with the appropriate priority was blocked on
it. It may fail if: [EINVAL] rwlock does not refer to an intialized
read-write lock object It shall not return EINTR.
pthread_rwlock_trywrlock/coverage.txt
This document defines the coverage for the pthread_rwlock_tryrdlock() function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_rwlock_unlock/assertions.xml
- pthread_rwlock_unlock( ) function shall release a lock held on
the read-write lock objectreferenced by rwlock If this function is called
to release a read lock from the read-write lock object and there are
other read locks currently held on this read-write lock object, the
read-write lock object remains in the read locked state. If this function
releases the last read lock for this read-write lock object, the
read-write lock object shall be put in the unlocked state with no
owners.
- If this function is called to release a write lock for this
read-write lock object, the read-write lock object shall be put in the
unlocked state.
- If there are threads blocked on the lock when it becomes
available, the scheduling policy shall determine which thread(s) shall
acquire the lock. If the Thread Execution Scheduling option is supported,
when threads executing with the scheduling policies SCHED_FIFO, SCHED_RR,
or SCHED_SPORADIC are waiting on the lock, they shall acquire the lock in
priority order when the lock becomes available. For equal priority
threads, write locks shall take precedence over read locks.
- If successful, the pthread_rwlock_unlock( ) function shall
return zero; otherwise, an error number shall be returned to indicate the
error. [EINVAL] rwlock doesn't refer to an intialized read-write lock
[EPERM] the current thread doesn't hold the lock on the rwlock The
pthread_rwlock_unlock( ) function shall not return an error code of
[EINTR].
pthread_rwlock_unlock/coverage.txt
This document defines the coverage for the pthread_rwlock_unlock() function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
NOTE:
pthread_rwlock_wrlock/assertions.xml
- pthread_rwlock_wrlock( ) function shall apply a write lock to
the read-write lock referenced by rwlock. The calling thread acquires the
write lock if no other thread (reader or writer) holds the read-write
lock rwlock. Otherwise, the thread shall block until it can acquire the
lock
- If a signal is delivered to a thread waiting for a read-write
lock for writing, upon return from the signal handler the thread resumes
waiting for the read-write lock for writing as if it was not
interrupted.
- If successful, the pthread_rwlock_wrlock( ) function shall
return zero; otherwise, an error number shall be returned to indicate the
error. It may fail if: [EDEADLK] The current thread already owns the
rwlock for writing or reading. Shall not return an error code of
[EINTR].
pthread_rwlock_wrlock/coverage.txt
This document defines the coverage for the pthread_rwlock_wrlock() function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_self/assertions.xml
- The function pthread_t pthread_self(void) returns the thread ID
of the calling thread. No errors are defined.
pthread_self/coverage.txt
This document defines the coverage for the pthread_self() function:
Assertion Tested?
1 YES
NOTE:
pthread_setcancelstate/assertions.xml
- The function int pthread_setcancelstate(int state, int*
oldstate); Atomically sets the cancelability state to 'state' and returns
the old cancelability state in the location referenced by 'oldstate'.
'state' can either be PTHREAD_CANCEL_ENABLE, or
PTHREAD_CANCEL_DISABLE.
- The cancelability state of a newly created thread is
PTHREAD_CANCEL_ENABLE.
- It returns a 0 on success. It may return an error code of:
[EINVAL] The specified state is not PTHREAD_CANCEL_ENABLE or
PTHREAD_CANCEL_DISABLE. It will not return EINTR.
pthread_setcancelstate/coverage.txt
This document defines the coverage for the pthread_setcancelstate function:
Assertion Tested?
1 YES
2 YES
3 YES
pthread_setcanceltype/assertions.xml
- The function int pthread_setcanceltype(int type, int* oldtype);
Atomically sets the cancelability type to 'type' and returns the old
cancelability type in the location referenced by 'oldtype'. 'state' can
either be PTHREAD_CANCEL_DEFERRED, or PTHREAD_CANCEL_ASYNCHRONOUS.
- The cancelability type of a newly created thread is
PTHREAD_CANCEL_DEFERRED.
- It returns a 0 on success. It may return an error code of:
[EINVAL] The specified state is not PTHREAD_CANCEL_DEFERRED or
PTHREAD_CANCEL_ASYNCHRONOUS. It will not return EINTR.
pthread_setcanceltype/coverage.txt
This document defines the coverage for the pthread_setcanceltype function:
Assertion Tested?
1 YES
2 YES
3 YES
pthread_setspecific/assertions.xml
- The function void *pthread_setspecific(pthread_key_t key) shall
acssociate a thread-specific value with a key obtained via a previouse
call to pthread_key_create. Different threads may bind different values
to the same key. Calling pthread_setspecific with a key value not
obtiained from pthread_key_create of after the key has been deleted with
pthread_key_delete is undefined.
- pthread_setspecific may be called from a thread-specific data
destructor function. A call to pthread_getspecific() from a
thread-specific data destructor routine may result either in lost storage
or in an infinite loop.
- It returns 0 upon success, and an error number otherwise: Shall
fail if: [ENOMEM] - Insufficient memory exists to associate the value
with the key May fail if: [EINVAL] - The key value is invalid
pthread_setspecific/coverage.txt
This document defines the coverage for the pthread_getspecific function:
Assertion Tested?
1 YES
2 NO *Will not test
3 YES *Will not test [ENOMEM]
NOTE:
pthread_sigmask/assertions.xml
- pthread_sigmask( ) function is used to examine or change (or
both) the calling thread's signal mask, independent of the number of
threads the process contains. The function shall be equivalent to
sigprocmask( ), but with the ability to be used in a thread of a
multi-threaded process.
- The sigprocmask( ) function is used to examine or change (or
both) the signal mask of the calling thread of a single-threaded
process.
- The argument set points to a set of signals to be used to change
the currently blocked set, unless the argument is a null pointer.
- The resulting set shall be the union of the current set and the
signal set pointed to by set, if the value of the argument how is
SIG_BLOCK.
- The resulting set shall be the signal set pointed to by set, if
the value of the argument how is SIG_SETMASK
- The resulting set shall be the intersection of the current set
and the complement of the signal set pointed to by set, if the value of
the argument how is SIG_UNBLOCK
- The previous mask shall be stored in the location pointed to by
oset, if the argument oset is not a null pointer.
- The value of the argument how is not significant and the
process's signal mask shall be unchanged, and thus the call can be used
to enquire about currently blocked signals, if the argument set is a null
pointer.
- After the call to sigprocmask(), if there are any pending
unblocked signals, at least one of those signals shall be delivered
before the call to sigprocmask() returns.
- The system shall not allow the blocking of signals which cannot
be ignored, and shall not cause an error to be indicated.
- If any of the SIGFPE, SIGILL, SIGSEGV, or SIGBUS signals are
generated while they are blocked, and the signal was not generated by the
kill(), sigqueue() or raise()functions, the result is undefined.
- The thread's signal mask shall not be changed, if sigprocmask(
) fails.
- In a multi-threaded process, the use of the sigprocmask( )
function is unspecified.
- pthread_sigmask( ) shall return 0, Upon successful completion;
otherwise, it shall return the corresponding error number.
- sigprocmask( ) shall return 0, Upon successful completion;
otherwise, it shall return -1 and errno shall be set to indicate the
error, and the process' signal mask shall be unchanged.
- An errno value of [EINVAL] shall be returned and the
pthreadsigmask() function shall fail, if the value of the how argument is
not equal to one of the defined values.
- An errno value of [EINVAL] shall be returned and the
sigprocmask() function shall fail, if the value of the how argument is
not equal to one of the defined values.
- An error code of [EINTR] shall not be returned by the
pthread_sigmask( ) function.
pthread_sigmask/coverage.txt
This document defines the coverage for function pthread_sigmask(). The functions pthread_sigmask()
and sigprocmask() are equivalent functions, but pthread_sigmask() should also work in a
multi-threaded process. The tests in this section are similar in n nature to the tests for the
sigprocmask() function, but calls will be made from threads that belong to multi-threaded processes
instead of single-threaded processes.
Assertion Covered?
1 IMPLICITLY tested by assertions 1-18
2 WON'T test. Pertains only to sigprocmask().
3 IMPLICITLY tested by assertions 4-6
4 YES
5 YES
6 YES
7 YES
8 YES
9 YES
10 YES
11 WON'T test, because POSIX does not define behavior in this case.
12 YES
13 WON'T test, because POSIX does not define behavior in this case.
14 YES
15 WON'T test, pertains only to sigprocmask()
16 YES
17 WON'T test, pertains only to sigprocmask()
18 NO, won't test for now.
pthread_spin_destroy/assertions.xml
- pthread_spin_destroy( ) function shall destroy the spin lock
referenced by lock and release any resources used by the lock.
- Upon successful completion, these functions shall return zero;
otherwise, an error number shall be returned to indicate the error.
- The functions may fail if: [EBUSY] The implementation has
detected an attempt to initialize or destroy a spin lock while it is in
use (for example, while being used in a pthread_spin_lock( ) call) by
another thread. [EINVAL] The value specified by lock is invalid. These
functions shall not return an error code of EINTR.
pthread_spin_destroy/coverage.txt
This document defines the coverage for the pthread_spin_destroy() function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_spin_init/assertions.xml
- The function int pthread_spin_init(pthread_spinlock_t *lock, int
pshared); shall allocate any resources required to use the spin lock
referenced by lock and initialize the lock to an unlocked state.
- If the Thread Process-Shared Synchronization option is supported
and the value of pshared is PTHREAD_PROCESS_SHARED, the implementation
shall permit the spin lock to be operated upon by any thread that has
access to the memory where the spin lock is allocated, even if it is
allocated in memory that is shared by multiple processes. If the Thread
Process-Shared Synchronization option is supported and the value of
pshared is PTHREAD_PROCESS_PRIVATE, or if the option is not supported,
the spin lock shall only be operated upon by threads created within the
same process as the thread that initialized the spinlock. If threads of
differing processes attempt to operate on such a spin lock, the behavior
is undefined.
- Upon successful completion, these functions shall return zero;
otherwise, an error number shall be returned to indicate the error.
- This function may fail if: -[EBUSY] The implementation has
detected an attempt to initialize or destroy a spin lock while it is in
use (for example, while being used in a pthread_spin_lock( ) by another
thread. -[EINVAL] The value specified by lock is invalid. It shall fail
if: -[EAGAIN] The system lacks the necessary resources to initialize
another spin lock. -[ENOMEM] Insufficient memory exists to initialize the
lock. These functions shall not return an error code of EINTR.
pthread_spin_init/coverage.txt
This document defines the coverage for the pthread_spin_init() function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
NOTE:
pthread_spin_lock/assertions.xml
- The function shall lock the spin lock referenced by lock. The
calling thread shall acquire the lock if it is not held by another
thread. Otherwise, the thread shall spin (that is, shall not return from
the pthread_spin_lock()) until the lock becomes available.
- Upon successful completion, these functions shall return zero;
otherwise, an error number shall be returned to indicate the error.
- The pthread_spin_lock( ) function may fail if: [EDEADLK] The
calling thread already holds the lock. [EINVAL] The value specified by
lock does not refer to an initialized spin lock object. These functions
shall not return an error code of EINTR.
pthread_spin_lock/coverage.txt
This document defines the coverage for the pthread_spin_lock() function:
Assertion Tested?
1 YES
2 YES
3 YES
NOTE:
pthread_spin_trylock/assertions.xml
- pthread_spin_trylock( ) function shall lock the spin lock
referenced by lock if it is not held by any thread. Otherwise, the
function shall fail.
- Upon successful completion, these functions shall return zero;
otherwise, an error number shall be returned to indicate the error.
- The pthread_spin_trylock( ) function shall fail if: [EBUSY] A
thread currently holds the lock.
- These functions may fail if: [EINVAL] The value specified by
lock does not refer to an initialized spin lock object. These functions
shall not return an error code of EINTR.
pthread_spin_trylock/coverage.txt
This document defines the coverage for the pthread_spin_trylock() function:
Assertion Tested?
1 YES
2 YES
3 YES
4 YES
NOTE:
pthread_spin_unlock/assertions.xml
- The pthread_spin_unlock( ) function shall release the spin lock
referenced by lock which was locked via the pthread_spin_lock( ) or
pthread_spin_trylock( ) functions.
- Upon successful completion, the pthread_spin_unlock( ) function
shall return zero; otherwise, an error number shall be returned to
indicate the error.
- The pthread_spin_unlock( ) function may fail if: [EINVAL] An
invalid argument was specified. [EPERM] The calling thread does not hold
the lock. These functions shall not return an error code of EINTR.
pthread_spin_unlock/coverage.txt
This document defines the coverage for the pthread_spin_unlock() function:
Assertion Tested?
1 YES
2 YES
3 YES "May" assertion, always pass
N