<commit_before>thread
======

Simple threading library for Go. `thread` allows you to ensure that certain
functions are called from certain OS threads.


Examples
========

The following example ensures that `foo` and `bar` are both called from the
same thread.

```go
t := thread.New()
go t.Run()
t.Do(foo)
t.Do(bar)
```

By calling `Run` directly from the main thread, all tasks get executed on this
thread.

```go
t := thread.New()
go func() {
  t.Do(foo)
  t.Do(bar)
}()
t.Run()
```

To stop the thread, use `Stop`. If you do not want to wait for the task to
complete, you can call `Do` from a goroutine:

```go
go t.Do(foo)
```<commit_msg>README cleanup and documentation link.<commit_after>thread
======

Simple threading library for Go. `thread` allows you to ensure that certain
functions are called from certain OS threads. Documentation can be found
[here](http://godoc.org/github.com/snorredc/thread).


Examples
--------

The following example ensures that `foo` and `bar` are both called from the
same thread.

```go
t := thread.New()
go t.Run()
t.Do(foo)
t.Do(bar)
```

By calling `Run` directly from the main thread, all tasks get executed on this
thread.

```go
t := thread.New()
go func() {
    t.Do(foo)
    t.Do(bar)
}()
t.Run()
```

To stop the thread, use `Stop`. If you do not want to wait for the task to
complete, you can call `Do` from a goroutine:

```go
go t.Do(foo)
```
{'fraction_non_alphanumeric': 0.14316392269148176, 'fraction_numerical': 0.0, 'mean_word_length': 3.837370242214533, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '391509', 'n_tokens_mistral': 479, 'n_tokens_neox': 460, 'n_words': 197}