Locking smart pointer

Hello!
I have a small class to show you and perhaps get some comments on:
<code>
#include

Mattias Brändström wrote:
The purpose of this class is to lock a mutex before each method call on an object of class T, and unlock the mutex when that call returns. It
This is highly suboptimal, I doubt anyone would want to do not knowing what exactly the cost is. B.

On Fri, 30 Jun 2006 12:26:57 +0200, Mattias Brändström wrote:
<snip>
The purpose of this class is to lock a mutex before each method call on an object of class T, and unlock the mutex when that call returns. It seems that this would be something that one would like to have in some cases. Maybe so many cases that it might be part of boost somewhere? I haven't found any library in boost that does this. Is there one?
I haven't done anything like this before so it would be nice if anyone here could make some comments on the code. Will it do what I think it does or will it blow up in my face? :-)
Regards, Mattias
Andrei Alexandrescu had something similar in the article http://www.ddj.com/dept/cpp/184403766. S> -- <<< Eagles may soar, but weasels don't get sucked into jet engines >>> 12:57pm up 20 days 22:24, 13 users, load average: 0.09, 0.06, 0.05 Registered Linux User #232457 | LFS ID 11703
participants (3)
-
Bronek Kozicki
-
Mattias Brändström
-
Spencer Collyer