Closed chrislusf closed 8 years ago
I've done a test changing a couple of structs. Basically when the struct contains a lock for itself lock is declared as anonymous field. When the struct contains an field that is lockable that field is declared as a lockable struct outside and embedded in the first one.
An example can be seen at:
https://github.com/monkeybutter/glow/commit/caa111b8ce1fb837917f4b1fcd9c49450167c52d
I haven't tested the code and I don't know how these changes would affect other functions using these structs outside the files where they've been declared. This is only an example to ask for feedback about the proposal.
Nice to learn this technique!
You can test by running the examples in both standalone mode and distributed mode.
Chris
On Wednesday, October 28, 2015, Pablo Rozas-Larraondo < notifications@github.com> wrote:
I've done a test changing a couple of structs. Basically when the struct contains a lock for itself lock is declared as anonymous field. When the struct contains an field that is lockable that field is declared as a lockable struct outside and embedded in the first one.
An example can be seen at:
monkeybutter@caa111b https://github.com/monkeybutter/glow/commit/caa111b8ce1fb837917f4b1fcd9c49450167c52d
I haven't tested the code and I don't know how these changes would affect other functions using these structs outside the files where they've been declared. This is only an example to ask for feedback about the proposal.
— Reply to this email directly or view it on GitHub https://github.com/chrislusf/glow/issues/7#issuecomment-152021515.
Need cleaner code.