Index: src/OFThread.m ================================================================== --- src/OFThread.m +++ src/OFThread.m @@ -250,10 +250,21 @@ #elif defined(OF_NINTENDO_3DS) if (timeInterval * 1000000000 > INT64_MAX) @throw [OFOutOfRangeException exception]; svcSleepThread((int64_t)(timeInterval * 1000000000)); +#elif defined(OF_AMIGAOS) + struct timerequest request = *DOSBase->dl_TimeReq; + + request.tr_node.io_Message.mn_ReplyPort = + &((struct Process *)FindTask(NULL))->pr_MsgPort; + request.tr_node.io_Command = TR_ADDREQUEST; + request.tr_time.tv_secs = (ULONG)timeInterval; + request.tr_time.tv_micro = (ULONG) + ((timeInterval - (unsigned int)timeInterval) * 1000000); + + DoIO((struct IORequest *)&request); #elif defined(HAVE_NANOSLEEP) struct timespec rqtp; rqtp.tv_sec = (time_t)timeInterval; rqtp.tv_nsec = (long)((timeInterval - rqtp.tv_sec) * 1000000000); @@ -260,15 +271,10 @@ if (rqtp.tv_sec != trunc(timeInterval)) @throw [OFOutOfRangeException exception]; nanosleep(&rqtp, NULL); -#elif defined(OF_AMIGAOS) - if (timeInterval * 50 > ULONG_MAX) - @throw [OFOutOfRangeException exception]; - - Delay(timeInterval * 50); #elif defined(OF_NINTENDO_DS) uint64_t counter; if (timeInterval > UINT64_MAX / 60) @throw [OFOutOfRangeException exception]; @@ -280,11 +286,11 @@ if (timeInterval > UINT_MAX) @throw [OFOutOfRangeException exception]; sleep((unsigned int)timeInterval); usleep((unsigned int) - (timeInterval - (unsigned int)timeInterval) * 1000000); + ((timeInterval - (unsigned int)timeInterval) * 1000000)); #endif } + (void)sleepUntilDate: (OFDate *)date {