made sure everything's thread safe
Pretty much everything already was, but I tweaked a few things to make
sure they stay that way and added various comments about that fact. Also
cleaned up a few things along the way and removed SafeMessageBuilder
because it wasn't.
diff --git a/aos/common/mutex.h b/aos/common/mutex.h
index a22df4e..ff953e4 100644
--- a/aos/common/mutex.h
+++ b/aos/common/mutex.h
@@ -30,7 +30,7 @@
// Locks the mutex. If it fails, it calls LOG(FATAL).
void Lock();
// Unlocks the mutex. Fails like Lock.
- // Multiple unlocking might be considered failure.
+ // Multiple unlocking is undefined.
void Unlock();
// Locks the mutex unless it is already locked.
// Returns whether it succeeded or not.
@@ -55,7 +55,6 @@
// A class that locks a Mutex when constructed and unlocks it when destructed.
// Designed to be used as a local variable so that
// the mutex will be unlocked when the scope is exited.
-// Should it fail for some reason, it dies with LOG(FATAL).
class MutexLocker {
public:
explicit MutexLocker(Mutex *mutex) : mutex_(mutex) {