更新时间:2022-06-01 02:05:41
问题是关于EXECUTE-AROUND模式。我在 https://gitlab.com/redistd/redistd/blob/master/include/redi/exec_around.h
The question is about the EXECUTE-AROUND pattern. I made a generic (but only barely tested) implementation of EXECUTE-AROUND POINTER at https://gitlab.com/redistd/redistd/blob/master/include/redi/exec_around.h
这允许:
struct X { void f() { } };
auto x = mutex_around<X>();
x->f(); // locks a mutex for duration of call to X::f
模式工作的家庭 here(pdf)