Commit Graph

82 Commits

Author SHA1 Message Date
Eugene Kabanov
254fbcc548 Fixes #4719. (#5585) 2017-03-23 16:13:38 +01:00
Eugene Kabanov
e20af5cec6 Fix #4972. (#5567) 2017-03-19 07:16:13 +01:00
Eugene Kabanov
336a7c9b3f Fixes to support Dragonfly BSD. (#5552)
* Fix kqueue.nim and ansi_c.nim to support dragonfly.
* Fix ioselectors.nim, threads.nim to support dragonfly.
* Fix deprecated dealloc call in tioselectors.nim.
* Fix tfsmonitor.nim test to run only on Linux.
* Fix osproc.nim return wrong exit codes.
* Fix getAppFilename() for dragonfly.
* Fix proper exit code handling.
2017-03-17 08:22:11 +01:00
Araq
4f062c3be0 removed onThreadCreation; onThreadDestruction is now thread local 2017-02-26 20:42:19 +01:00
Anatoly Galiulin
6fa1dba515 Add `tearDownForeignThreadGc` function (#5369) 2017-02-13 13:37:20 +01:00
Yuriy Glukhov
3978845266 Use __NR_gettid instead of SYS_gettid (#5338) 2017-02-04 21:18:54 +01:00
Andreas Rumpf
d12a5a6525 make getThreadId() work on OSX 2017-01-31 16:06:37 +01:00
araq
bd580e9d6e another attempt to getThreadId work on Linux 2017-01-31 15:44:11 +01:00
araq
eaa0eda72d make getThreadId() work on Linux 2017-01-31 13:49:32 +01:00
Araq
b173499543 added system.getThreadId for various OSes (untested) 2017-01-31 13:06:19 +01:00
Andreas Rumpf
f7e3addb89 bugfix: onThreadDestruction callbacks should be run in reverse order 2017-01-26 11:28:25 +01:00
Andreas Rumpf
eb96eaa5c2 onThreadDestruction feature added to Nim's threading model 2017-01-24 12:07:44 +01:00
Araq
572fd067cf added system.runOnThreadCreationHandlers for initialization of thread local storage for the main thread 2017-01-20 20:32:41 +01:00
Andreas Rumpf
61937974e2 added system.onThreadCreation feature for safe thread local storage initializations 2017-01-18 13:41:55 +01:00
Fabian Keller
5f6f444d55 naive work-around for time redefinition (#5193) 2017-01-08 17:53:43 +01:00
Andreas Rumpf
a93ca14418 disable pinToCpu for OSX 2017-01-07 13:27:16 +01:00
Andreas Rumpf
bc53d2c9de bugfix: bottom of AVL tree is now threadsafe 2016-09-24 02:27:12 +02:00
Andreas Rumpf
03768e7da0 attempt to fix #4640 2016-09-13 16:33:43 +02:00
Andreas Rumpf
479373ad79 fixes #4088 2016-09-11 23:48:59 +02:00
coffeepots
ea03199400 Add handle function to Thread type
Exposes SysThread type and introduces the function "handle" to return Thread.sys.
2016-07-27 14:56:52 +01:00
Andreas Rumpf
0834cd63d9 prepare Nim codebase for upcoming parser changes 2016-07-15 12:56:03 +02:00
Jacek Sieka
8d7a45f205 prefer consts to importing #defines from headers
to be completed - better would be to have a libc wrapper that deals with
all pesky C ABI details
2016-06-06 23:00:00 +08:00
Hans Raaf
5385798838 Made nimphpext work with gc:stack. 2016-05-25 02:25:48 +02:00
Araq
03550f14f8 createThread is more convenient to use with a proc taking no arguments 2015-10-19 16:09:35 +02:00
Reimer Behrends
639b5e0069 Properly register threads with the Boehm GC.
In order to be able to scan thread stacks, the Boehm GC needs to know
about newly created threads. We establish the end of the stack by using
GC_call_with_stack_base (this works properly also with the dual-stack
Itanium architecture) and then GC_register_my_thread() to register a
thrad and GC_unregister_my_thread() to unregister it again.

This patch also includes a modification for the refc and markandsweep
collectors to set the stack bottom for thread stacks correctly even if
an optimizer aggressively inlines and optimizes procedures (this is
already being done for the stack of the main thread).

Finally, we use the {.noconv.} pragma for the Boehm GC, as the Boehm
API uses no specific calling convention.
2015-09-08 19:01:06 +02:00
Araq
20c2b00822 make --gc:none work with --threads:on 2015-08-26 23:59:00 +02:00
Araq
70fe773bbe implemented system.pinToCpu 2015-07-01 02:15:22 +02:00
Sergey Avseyev
70ce8695e7 Fix #2672. Do not define globalsSlot for native TLS
Motivation
----------
globalsSlot is always defined so threading code works incorrectly when
native TLS supported.

Modification
------------
Defined globalsSlot only in TLS emulation mode. Remove myThreadId, which
based on broken behavior. It might be reimplemented later

Result
------
No segfaults.
2015-06-26 07:42:58 +03:00
Sergey Avseyev
f9d8d6ce09 Trim trailling spaces 2015-06-26 07:42:58 +03:00
Stefan Talpalaru
bdac85f2cf Merge branch 'devel' into gogc 2015-06-15 08:44:02 +02:00
pdw
2ca90a20a1 lib/system/g-w - Dropped 'T' from types 2015-06-04 13:18:37 +02:00
Stefan Talpalaru
50e96ad939 the Go GC - initial implementation 2015-05-31 19:07:44 +02:00
Philip Wernersbach
f8d6d74368 Fix pthread_create binding when compiling in C++ mode.
C++ has different rules for void pointers, which causes the binding
to be invalid when compiling in C++ mode.
2015-03-15 17:33:46 -04:00
Araq
3dd1ecbae4 fixes #2074 2015-02-26 02:05:23 +01:00
Hans Raaf
55ab6cc2b3 Disable -pthread for linker on OSX
The -pthread is not needed on Darwin/OS X and the Apple compilers give a
warning about this if you use --threads:on with the Nim compiler.
2015-02-13 01:51:46 +01:00
Araq
af84f754b0 proper fix for stack initialization and threadvar emulation 2014-11-11 09:55:31 +01:00
Reimer Behrends
c43e7c4ff6 Remove references to pthread_mutex_timedlock().
The pthread_mutex_timedlock() function is not supported on a number
of architectures and is not actually used by the library or compiler,
but prevents C++ compilation on systems that do not support it when
threads are enabled.
2014-11-06 02:23:40 +01:00
Araq
9d9c3fe121 merged things from devel 2014-09-12 01:37:48 +02:00
Araq
24afab2a95 Threads work again 2014-09-11 09:36:22 +02:00
Araq
30823c1ce3 make tests green 2014-08-31 15:15:26 +02:00
Dominik Picheta
8446d51a6a Winlean and threads case sensitivity fixes. 2014-08-30 12:57:04 +01:00
Araq
dbf9117c56 the big renamefest: first steps 2014-08-22 23:54:26 +02:00
Araq
dd806cafa0 distinguish between 'defined' and 'declared' 2014-08-11 20:38:28 +02:00
Araq
fab8cee13d minor tweaks; updated todo.txt 2014-04-25 19:54:42 +02:00
Araq
e6d17e6273 made large parts of the stdlib gcsafe 2014-04-20 20:01:24 +02:00
Araq
346443d1b5 case consistency improvements 2014-01-11 21:56:05 +01:00
Satish BD
033938a53a Correct the spelling of the word 'implicitly' 2013-12-23 04:29:50 +02:00
Araq
f59e502382 better error message for implicitly available modules 2013-12-01 14:04:15 +01:00
Grzegorz Adam Hankiewicz
2b517161e4 Adds link to manual thread memory section from threads module. 2013-05-10 23:33:01 +02:00
Grzegorz Adam Hankiewicz
72a3e21f28 Removes executable bit for text files. 2013-03-16 23:53:07 +01:00