Question: I just got a Beagle Board and started working with Cloud9. Everything worked fine until I tried to integrate it with Github. 

I could git init because I "didn't have sudo permissions" on Cloud9. Therefore, I cloned a repo to use with Cloud9. **Now, however, it looks like the Beagle Board dependencies are no longer there.** I get this error:

![enter image description here](https://i.stack.imgur.com/Zar2r.png)

The code I'm trying to run (which gets the error) is:

```
var b = require("bonescript");
b.pinMode('USR0', b.OUTPUT);
b.digitalWrite('USR0', b.HIGH);

```

Answer: 
The operating system matters, but it is rather universal. The thread gets *scheduled* to execute. When the operating system gets around to actually make it run is entirely unpredictable. You'll have decent odds for "quickly" on a machine with multiple cores, universally available today.

thread::join() just ensures that the thread finished executing. You would *never* actually write code like this, it is completely pointless to start a thread and then wait for it to complete. Might as well execute the thread's code directly. Same outcome without bogging down the operating system with creating a thread.
> 
> Is the thread being executed when I call join() or is it being run
>  sometime between when create the thread and when I call join?
> 
> 
> 

The thread is executed (started) after you create the thread, depending on the available resources that might take some time. The `join()` method waits(blocks) until the thread has finished its work. 

A suggestion: i would not name the variable to the `Sync` object `This`, its confusing, since there exists the `this` keyword.

You can safely delete the `std::thread` object after calling `join()` in `Async::Inc()`, plus you don't need to store the reference as a member variable, it's only used in that function.

You might also take a look at the `<atomic>` header, `std::atomic<int>` or `std::atomic_int`.