October 26, 2018 Help needed to extend the core.thread | ||||
---|---|---|---|---|
| ||||
I want make some extensions to Thread in core.thread and wan. So I copy the whole of core.thread to another module named myext.thread. Here are two errors occurred: 1)When building this module In function `_D4myext6thread6Thread9termLocksFNiZv': /home/dlang/UnitTest/source/myext/thread.d:1723: undefined reference to `_D4core4sync5mutex5Mutex6__dtorMFNiNeZv' 2)When running a simple demo with empty main(). Program exited with code -11 It seems it is bad idea to do so. Maybe it's better to extend core.thread.Thread by inheriting it. Am I right? Thanks! |
October 26, 2018 Re: Help needed to extend the core.thread | ||||
---|---|---|---|---|
| ||||
Posted in reply to Heromyth | On Friday, 26 October 2018 at 01:58:47 UTC, Heromyth wrote: > Maybe it's better to extend core.thread.Thread by inheriting it. > Am I right? Thanks! Yes, see the example at https://dlang.org/phobos/core_thread.html#.Thread |
Copyright © 1999-2021 by the D Language Foundation