11 Commits
Author SHA1 Message Date
Norman Maurer 784c5a7355 Declare ThreadSpecificVariable public (#102)
Motivation:

It's often useful for users to be able to store a thread-specific value (and so also EventLoop specific). We have ThreadSpecificVariable for this which was internal.

Modifications:

Change ThreadSpecificVariable to be public.

Result:

Fixes [#61].
2018-03-06 00:32:05 +09:00
John Connolly fa60fa8c40 Change class func to static on Thread. (#101)
Motivation:
Thread is declared final, so I believe spawnAndRun should be static.

Modifications:
Change class func to static
Result:
More consistent code, and spawnAndRun is statically dispatched.
2018-03-06 00:12:23 +09:00
adamnemecek 0bbed6d72f * removed trailing whitespace (#52) 2018-03-02 15:40:52 +09:00
Johannes Weiß 73a805c7f6 minor stylistic improvements (#36)
Motivation:

Sometimes we deviated from the style the Swift stdlib sets out for no
reason.

Modifications:

Fixed some stylistic deviations.

Result:

Looks more Swift-like.
2018-02-26 15:52:49 +00:00
Norman Maurer 4f75af6582 Allow access to pthread_t via withUnsafe function.
Motivation:

We should better allow access to pthread_t via an withUnsafe function which is more swift-like.

Modifications:

- Add withUnsafePthread and use it
- mark pthread_t as private in Thread.

Result:

More swifty code.
2018-02-12 12:29:07 +01:00
Norman Maurer 0b5d59fd25 Consolidate #if #else blocks and use precondition
Motivation:

We sometimes used fatalError(...) where we really could just use precondation(...). Beside this we can also consolidate the #if #else code for handling Darwin and Linux differently and so make the code easier to maintain.

Modifications:

- Use precondation
- Consoldate #if #else blocks for Thread

Result:

Cleaner and easier to maintain code.
2018-02-12 09:21:14 +01:00
Johannes Weiß ebf351abda implement thread specific values 2018-02-08 17:37:01 +00:00
Norman Maurer 995177fbc6 Support setting Thread affinity and use it with EventLoopGroups 2018-02-06 16:08:57 +01:00
Johannes Weiß b26bfce61e detach threads so we don't leak them 2018-02-08 10:57:51 +00:00
Norman Maurer 71f179e63b Change Thread to be internal as we not expose it to the user 2018-02-08 09:26:53 +01:00
Norman Maurer e1bf447a9a Replace usage of Foundation.Thread with our own Thread that just used…
* Replace usage of Foundation.Thread with our own Thread that just used pthread

* Address comments

* some more docs / comments

* Address comments of cory
2018-02-06 11:45:57 +01:00