mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2025-12-26 17:18:24 +00:00
[smart] split out part of lwp_new() to lwp_create()
Prev implementation of lwp_new() including the create of lwp object and the pid allocation. But not every lwp object need a pid. So this patch split out the business of lwp_new() to improve the maintainability. Signed-off-by: Shell <smokewood@qq.com>
This commit is contained in:
@@ -17,11 +17,16 @@
|
||||
extern "C" {
|
||||
#endif
|
||||
|
||||
#define LWP_CREATE_FLAG_NONE 0x0000
|
||||
#define LWP_CREATE_FLAG_ALLOC_PID 0x0001 /* allocate pid on lwp object create */
|
||||
|
||||
struct rt_lwp;
|
||||
|
||||
struct lwp_avl_struct *lwp_get_pid_ary(void);
|
||||
|
||||
struct rt_lwp* lwp_new(void);
|
||||
/* create a lwp object */
|
||||
struct rt_lwp* lwp_create(rt_base_t flags);
|
||||
|
||||
void lwp_free(struct rt_lwp* lwp);
|
||||
|
||||
int lwp_ref_inc(struct rt_lwp *lwp);
|
||||
|
||||
Reference in New Issue
Block a user