This is the mail archive of the cygwin mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: pthread_attr_init() returning errors


On 19.4.2016 21:49, Canham, Timothy K (348C) wrote:
> I have some code to start a task that suddenly started failing. This is pretty mature code. Here is the code fragment with my added printf()
> 
>         pthread_attr_t att;
>         int stat = pthread_attr_init(&att);
>         if (stat != 0) {
>             printf("pthread_attr_init: (%d)(%d): %s\n",stat,errno,strerror(stat));
>             // return
>         }
> 
> Here is the output:
> 
> pthread_attr_init: (16)(0): Device or resource busy
> 
> If I don't return in the if statement, the subsequent pthread_create() seems to work just fine.

Does it work if you do `memset(&att, 0, sizeof(att));` before the
`pthread_attr_init(&att)`?

-- 
VH

Attachment: signature.asc
Description: OpenPGP digital signature


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]