File tree 2 files changed +10
-1
lines changed
2 files changed +10
-1
lines changed Original file line number Diff line number Diff line change @@ -1832,6 +1832,7 @@ long _sys_clone(void *arg[])
1832
1832
rt_thread_t thread = RT_NULL ;
1833
1833
rt_thread_t self = RT_NULL ;
1834
1834
int tid = 0 ;
1835
+ rt_err_t err ;
1835
1836
1836
1837
unsigned long flags = 0 ;
1837
1838
void * user_stack = RT_NULL ;
@@ -1935,6 +1936,8 @@ long _sys_clone(void *arg[])
1935
1936
rt_thread_startup (thread );
1936
1937
return (long )tid ;
1937
1938
fail :
1939
+ RT_ASSERT (err < 0 );
1940
+
1938
1941
lwp_tid_put (tid );
1939
1942
if (thread )
1940
1943
{
@@ -1944,7 +1947,7 @@ long _sys_clone(void *arg[])
1944
1947
{
1945
1948
lwp_ref_dec (lwp );
1946
1949
}
1947
- return GET_ERRNO () ;
1950
+ return ( long ) err ;
1948
1951
}
1949
1952
1950
1953
rt_weak long sys_clone (void * arg [])
Original file line number Diff line number Diff line change @@ -88,6 +88,12 @@ int lwp_tid_get(void)
88
88
current_tid = tid ;
89
89
}
90
90
lwp_mutex_release_safe (& tid_lock );
91
+
92
+ if (tid <= 0 )
93
+ {
94
+ LOG_W ("resource TID exhausted." );
95
+ }
96
+
91
97
return tid ;
92
98
}
93
99
You can’t perform that action at this time.
0 commit comments