Linux and UNIX Man Pages

Linux & Unix Commands - Search Man Pages

pthread_attr_setcreatesuspend_np(3) [netbsd man page]

PTHREAD_ATTR_SETCREATESUSPEND_NP(3)			   BSD Library Functions Manual 		       PTHREAD_ATTR_SETCREATESUSPEND_NP(3)

NAME
pthread_attr_setcreatesuspend_np -- set attribute to create a thread suspended LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread.h> int pthread_attr_setcreatesuspend_np(pthread_attr_t attr); DESCRIPTION
The pthread_attr_setcreatesuspend_np() function sets the attr argument, so that if this attr is used in a pthread_create(3) call, then the thread created will not run, but it will remain blocked in the suspended queue, until pthread_resume_np(3) is called on it. RETURN VALUES
The pthread_attr_setcreatesuspend_np() function always returns 0. COMPATIBILITY
The function is a non-standard extension. ERRORS
No errors are defined. SEE ALSO
pthread_create(3), pthread_resume_np(3), pthread_suspend_np(3) BSD
July 9, 2010 BSD

Check Out this Related Man Page

PTHREAD_CREATE(3)					   BSD Library Functions Manual 					 PTHREAD_CREATE(3)

NAME
pthread_create -- create a new thread LIBRARY
POSIX Threads Library (libpthread, -lpthread) SYNOPSIS
#include <pthread.h> int pthread_create(pthread_t * restrict thread, const pthread_attr_t * restrict attr, void *(*start_routine)(void *), void * restrict arg); DESCRIPTION
The pthread_create() function is used to create a new thread, with attributes specified by attr, within a process. If attr is NULL, the default attributes are used. The attributes specified via attr are copied into the new thread. Any subsequent modifications to the attributes object attr points to will have no effect upon already-created threads. It is thus also safe to pass the same attr to multiple calls to pthread_create(). Upon successful completion pthread_create() will store the ID of the created thread in the location specified by thread. The thread is cre- ated executing start_routine with arg as its sole argument. If the start_routine returns, the effect is 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 differs from this. When it returns from main(), the effect is 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 is initialized as: o The signal mask is inherited from the creating thread. o The set of signals pending for the new thread is empty. RETURN VALUES
If successful, the pthread_create() function will return zero. Otherwise an error number will be returned to indicate the error. ERRORS
pthread_create() shall fail if: [EAGAIN] The system lacks the necessary 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. SEE ALSO
fork(2), pthread_attr(3), pthread_cleanup_pop(3), pthread_cleanup_push(3), pthread_exit(3), pthread_join(3) STANDARDS
The function conforms to IEEE Std 1003.1-2001 (``POSIX.1''). BSD
July 9, 2010 BSD
Man Page

5 More Discussions You Might Find Interesting

1. Programming

Pthread_create issue

Hello My problem goes like this: I have used Pthread_create, and I have tryed to create 2 proccess but nothing happens! It does not even matter what the function im trying to create do. It is if im trying to activate an empty function. This is my code. Any help will be highly appreciated.... (1 Reply)
Discussion started by: Hellboy
1 Replies

2. Programming

How Can I use pthread_create ?

Hi. I use C++ and I wishes to create a thread with the pthread_create function, my question is, how can I do this if I wish that the function will be a member of the class ?? I know from windows programming that I can declare a static function like this static unsigned int __stdcall... (7 Replies)
Discussion started by: shvalb
7 Replies

3. Programming

[c] is -lpthread correct option?

I read somewhere that I should use -pthread instead of -lpthread as compiler/linker flag, or define _REENTRANT. Is this incorrect to use only -lpthread? (I use gcc) (5 Replies)
Discussion started by: dawwin
5 Replies

4. UNIX for Dummies Questions & Answers

Pthread_create problem

Hi, I'm trying to do my homework assignment but I am having trouble using the pthread_create fucntion. Here is my code________________ //Alicia Johnson //sum_pid program //creates n number of threads. These threads create a random number //then adds the number to a global array. Then... (1 Reply)
Discussion started by: ajohns38
1 Replies

5. Programming

A weird problem with POSIX function

Hi all, Sorry for the title because I didn't find a proper name for it. My question is about POSIX functions, such as timer_create(), mq_open() and pthread_create(). void test_queue() { struct mq_attr attr; attr.mq_maxmsg = 10; attr.mq_msgsize = 64; mq_unlink("/my_test_queue");... (6 Replies)
Discussion started by: bus147
6 Replies