Download Reference Manual
The Developer's Library for D
About Wiki Forums Source Search Contact

Ticket #603 (closed defect: fixed)

Opened 1 year ago

Last modified 1 year ago

Thread.sleep doesn't compile

Reported by: Carlos Assigned to: sean
Priority: blocker Milestone: 0.99.1 RC4
Component: Core Functionality Version: trunk
Keywords: Cc:

Description

gdmd -c -release -O -inline -version=Posix -q,-nostdinc -I/Users/carlos/Development/d/tango/trunk/lib/common -I/Users/carlos/Development/d/tango/trunk/lib/.. -I/Users/carlos/Development/d/tango/trunk/lib/compiler/gdc -v1 -Hfcore/Thread.di core/Thread.d -ofcore/Thread.o
core/Thread.d:778: Error: undefined identifier i
core/Thread.d:785: Error: undefined identifier i
core/Thread.d:786: Error: undefined identifier i
core/Thread.d:786: Error: cannot implicitly convert expression (cast(double)i % 1.0e+0 * 1.0e+9) of type double to long
core/Thread.d:793: Error: undefined identifier errno
core/Thread.d:793: Error: undefined identifier EINTR

I'm guessint that 'i' should be 'period'.

Change History

08/31/07 14:13:37 changed by sean

  • status changed from new to closed.
  • resolution set to fixed.

Hopefully closed by changeset [2530].

By the way, can you check the OSX C headers and tell me the definition of struct timespec? I have a sneaking feeling the Tango def should be using c_long instead of long.

08/31/07 14:18:17 changed by Carlos

Not yet:

core/Thread.d:786: Error: cannot implicitly convert expression (period) of type float to int
core/Thread.d:787: Error: cannot implicitly convert expression (cast(double)period % 1.0e+0 * 1.0e+9) of type double to long

Here's timespec from time.h

struct timespec {
        time_t  tv_sec;         /* seconds */
        long    tv_nsec;        /* and nanoseconds */  
};

08/31/07 14:20:36 changed by Carlos

  • status changed from closed to reopened.
  • resolution deleted.

Forgot to reopen.

08/31/07 14:27:02 changed by sean

  • status changed from reopened to closed.
  • resolution set to fixed.

Let's try that again.

08/31/07 14:32:30 changed by Carlos

  • status changed from closed to reopened.
  • resolution deleted.

It compiles now, but not all examples link:

bud concurrency/fiber_test.d -noautoimport -op -clean -full -g -debug -I.. -Tconcurrency/fiber_test -unittest
/usr/bin/ld: Undefined symbols:
__D5tango4stdc5errno5errnoFZi

08/31/07 14:41:15 changed by sean

  • status changed from reopened to closed.
  • resolution set to fixed.

I've got a fix in for the link error. Not ideal, but it'll do.

The alternative would be to make the errno routines template functions, but that would litter defs all over the place just to solve this problem in the runtime.

08/31/07 14:53:17 changed by Carlos

Ok, they all link now. Thanks!

09/07/07 04:21:53 changed by larsivi

  • milestone changed from 1.0 to 0.99.1 RC4.