Opened 4 years ago

Last modified 19 months ago

#16723 closed enhancement

THR: build FAILED - conformance/interfaces/pthread_barrierattr_getpshared/2-1.c — at Version 1

Reported by: cocobean Owned by: nobody
Priority: normal Milestone: R1/beta5
Component: System/POSIX Version: R1/Development
Keywords: POSIX, pthreads, pthread_barrierattr_getpshared Cc:
Blocked By: Blocking:
Platform: All

Description (last modified by cocobean)

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>.

Steps:

1. Create a piece of shared memory object, create pthread barrier object 'barrier' and set the PTHREAD_PROCESS_SHARED attribute.
2. Parent map the shared memory to its memory space, put 'barrier' into it;
3. Parent fork to create child process;
4. Child process map the 'barrier' to its memory space;
5. Parent and Child execute same code: loop N times, calling pthread_barrier_wait()
6. Parent and Child should not block on pthread_barrier_wait() 	

Expected Result: Test Passed

Tested on: Haiku hrev54840 x86 with Open POSIX Test Suite 1.5.2

Change History (1)

comment:1 by cocobean, 4 years ago

Description: modified (diff)
Note: See TracTickets for help on using tickets.