Threads

Kagamin spam at here.lot
Wed Mar 22 07:16:43 UTC 2023


static is thread local by default.

```
module main;
import app;
import core.thread;

int main(string[] args)
{
      static shared int result;
      static shared string[] args_copy;

      static void app_thread()
      {
          App app = new App();
          result = app.run(args_copy);
      }

      args_copy = cast(shared)args;

      // Running app interface in a thread;
      Thread thread = new Thread(&app_thread).start();
      thread.join();

      return result;
}
```


More information about the Digitalmars-d-learn mailing list