[haiku-bugs] Re: [Haiku] #16723: THR: build FAILED - conformance/interfaces/pthread_barrierattr_getpshared/2-1.c

  • From: "Haiku" <trac@xxxxxxxxxxxx>
  • To: undisclosed-recipients: ;
  • Date: Tue, 05 Jan 2021 20:34:15 -0000

#16723: THR: build FAILED -
conformance/interfaces/pthread_barrierattr_getpshared/2-1.c
-------------------------+-------------------------------------------------
  Reporter:  cocobean    |      Owner:  nobody
      Type:              |     Status:  new
  enhancement            |
  Priority:  normal      |  Milestone:  Unscheduled
 Component:              |    Version:  R1/Development
  System/POSIX           |   Keywords:  POSIX, pthreads,
Resolution:              |  pthread_barrierattr_getpshared
Blocked By:              |   Blocking:
  Platform:  All         |
-------------------------+-------------------------------------------------
Description changed by cocobean:

Old description:

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()

}}}

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

New description:

 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

--
-- 
Ticket URL: <https://dev.haiku-os.org/ticket/16723#comment:1>
Haiku <https://dev.haiku-os.org>
The Haiku operating system.

Other related posts: