Fixed trap handler and new_thread.
- Explicitly say in cmpxchg that "weak" is boolean. - The signature of the trap handler and the new_thread API are corrected so that input parameters are values and output parameters are pointers to values. - In trap handler, the "values" array is now a pointer to a client-allocated array. The client is also responsible for freeing it by providing a "freer". This is solely for working around the C programming language's limitation that "raw arrays (T*) do not know how to deallocate themselves". Garbage-collected languages (such as Haskell, Java, ...) and ownership-based languages (C++, rust) do not have such problems.
Showing with 50 additions and 22 deletions