Re: correct pthread call

Bob Knighten (knighten@co.intel.com)
Tue, 24 Jun 1997 11:29:22 -0700 (PDT)

Steve Huss-Lederman writes:
> On 174:29, the sample code has the call:
>
> pthreadinit(reduce_thread, (void*)&args);
>
> The correct syntax may be:
>
> pthread_t thread;
> ...
> pthread_create(&thread, NULL, reduce_thread, args);
>
> but we are not posative. If anyone knows for sure, please let us
> know.
>
> Thanks,
> Steve

>From the standard (ISO/IEC 9945-1:1996, Sec. 16.2.2 Thread Creation, p. 336):

int pthread_create(pthread_t *thread, const pthread_attr_t *attr,
void *(*start_routine)(void *), void *arg);

-----

NULL for the attr means the default thread attributes are used.

-- Bob

-- 
Robert L. Knighten	               | knighten@co.intel.com
Server Architecture Lab                |
Intel Corporation                      | 
5200 N.E. Elam Young Parkway, CO3-202  | (503) 677-4315
Hillsboro, OR 97124-6497	       | (503) 677-6700 [FAX]