+class MutexPtr
+{
+public:
+ MutexPtr(T *d, Mutex &m): mutex(new MutexLock(m)), data(d) { }
+
+ T &operator*() const { return *data; }
+ T *operator->() const { return data; }
+ void clear() { mutex=0; data=0; }
+private:
+ RefPtr<MutexLock> mutex;
+ T *data;
+};
+
+/*template<typename T>