| Thread overview | ||||||
|---|---|---|---|---|---|---|
|
May 13, 2015 core.thread.[Ss]leep - Is this a bug? | ||||
|---|---|---|---|---|
| ||||
On windows, core.thread.Sleep (big 'S') On linux core.thread.sleep (little 'S') I'm trying to import as little symbols as possible, so was importing specific items like import core.thread : Sleep; but it fails when I compile on linux, so I need to do a version(Windows) import core.thread : Sleep; version(Posix) import core.thread : sleep; Seems like a bug? | ||||
May 13, 2015 Re: core.thread.[Ss]leep - Is this a bug? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to wobbles | On Wednesday, 13 May 2015 at 20:09:44 UTC, wobbles wrote:
> On windows,
> core.thread.Sleep (big 'S')
>
> On linux
> core.thread.sleep (little 'S')
>
>
> I'm trying to import as little symbols as possible, so was importing specific items like
> import core.thread : Sleep;
>
> but it fails when I compile on linux, so I need to do a
> version(Windows) import core.thread : Sleep;
> version(Posix) import core.thread : sleep;
>
> Seems like a bug?
No, you should be calling Thread.sleep (capital T) instead.
| |||
May 13, 2015 Re: core.thread.[Ss]leep - Is this a bug? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to John Chapman | On Wednesday, 13 May 2015 at 20:16:34 UTC, John Chapman wrote:
> On Wednesday, 13 May 2015 at 20:09:44 UTC, wobbles wrote:
>> On windows,
>> core.thread.Sleep (big 'S')
>>
>> On linux
>> core.thread.sleep (little 'S')
>>
>>
>> I'm trying to import as little symbols as possible, so was importing specific items like
>> import core.thread : Sleep;
>>
>> but it fails when I compile on linux, so I need to do a
>> version(Windows) import core.thread : Sleep;
>> version(Posix) import core.thread : sleep;
>>
>> Seems like a bug?
>
> No, you should be calling Thread.sleep (capital T) instead.
I have been calling Thread.sleep
I didn't even need to be importing [Ss]leep all this time!
D'oh!
| |||
May 13, 2015 Re: core.thread.[Ss]leep - Is this a bug? | ||||
|---|---|---|---|---|
| ||||
Posted in reply to wobbles | On Wednesday, 13 May 2015 at 20:09:44 UTC, wobbles wrote:
> On windows,
> core.thread.Sleep (big 'S')
>
> On linux
> core.thread.sleep (little 'S')
>
>
> I'm trying to import as little symbols as possible, so was importing specific items like
> import core.thread : Sleep;
>
> but it fails when I compile on linux, so I need to do a
> version(Windows) import core.thread : Sleep;
> version(Posix) import core.thread : sleep;
>
> Seems like a bug?
You are importing the C functions.
The subtle name difference actually helped you find a bug, because these functions do different things (sleep takes a number of seconds, but Sleep takes milliseconds).
| |||
Copyright © 1999-2021 by the D Language Foundation
Permalink
Reply