diff options
Diffstat (limited to 'cpukit/posix/src/psignal.c')
-rw-r--r-- | cpukit/posix/src/psignal.c | 18 |
1 files changed, 7 insertions, 11 deletions
diff --git a/cpukit/posix/src/psignal.c b/cpukit/posix/src/psignal.c index 32f6975c84..5224601e32 100644 --- a/cpukit/posix/src/psignal.c +++ b/cpukit/posix/src/psignal.c @@ -244,15 +244,11 @@ unsigned int sleep( unsigned int seconds ) { - _Thread_Disable_dispatch(); - _Thread_Set_state( _Thread_Executing, STATES_WAITING_FOR_TIME ); - _Watchdog_Initialize( - &_Thread_Executing->Timer, - _Thread_Delay_ended, /* XXX may need to be POSIX specific */ - _Thread_Executing->Object.id, - NULL - ); - _Watchdog_Insert_seconds( &_Thread_Executing->Timer, seconds ); - _Thread_Enable_dispatch(); - return 0; /* XXX should account for signal */ + /* XXX can we get away with this implementation? */ + struct timespec tp; + + tp.tv_sec = seconds; + tp.tv_nsec = 0; + + return nanosleep( &tp, NULL ); } |