Add API to create threads with given stacksize
This commit is contained in:
parent
9398a6f60a
commit
515ffbdfe2
|
@ -65,6 +65,13 @@ LIBPBD_API void pthread_kill_all (int signum);
|
|||
LIBPBD_API const char* pthread_name ();
|
||||
LIBPBD_API void pthread_set_name (const char* name);
|
||||
|
||||
LIBPBD_API int pbd_pthread_create (
|
||||
const size_t stacksize,
|
||||
pthread_t *thread,
|
||||
void *(*start_routine) (void *),
|
||||
void *arg);
|
||||
|
||||
|
||||
LIBPBD_API int pbd_realtime_pthread_create (
|
||||
const int policy, int priority, const size_t stacksize,
|
||||
pthread_t *thread,
|
||||
|
|
|
@ -222,6 +222,23 @@ pthread_cancel_one (pthread_t thread)
|
|||
pthread_mutex_unlock (&thread_map_lock);
|
||||
}
|
||||
|
||||
int
|
||||
pbd_pthread_create (
|
||||
const size_t stacksize,
|
||||
pthread_t *thread,
|
||||
void *(*start_routine) (void *),
|
||||
void *arg)
|
||||
{
|
||||
int rv;
|
||||
|
||||
pthread_attr_t attr;
|
||||
pthread_attr_init (&attr);
|
||||
pthread_attr_setstacksize (&attr, stacksize);
|
||||
rv = pthread_create (thread, &attr, start_routine, arg);
|
||||
pthread_attr_destroy (&attr);
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
pbd_absolute_rt_priority (int policy, int priority)
|
||||
{
|
||||
|
@ -246,8 +263,6 @@ pbd_absolute_rt_priority (int policy, int priority)
|
|||
return priority;
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
pbd_realtime_pthread_create (
|
||||
const int policy, int priority, const size_t stacksize,
|
||||
|
@ -272,6 +287,7 @@ pbd_realtime_pthread_create (
|
|||
pthread_attr_destroy (&attr);
|
||||
return rv;
|
||||
}
|
||||
|
||||
int
|
||||
pbd_set_thread_priority (pthread_t thread, const int policy, int priority)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue
Block a user