| … | … | @@ -228,6 +228,14 @@ void CogSimpleStorage::proxy_open(void) |
| 228 | 228 | |
| 229 | 229 | void CogSimpleStorage::proxy_close(void) |
| 230 | 230 | { |
| 231 | // The barrier forces the cogserver to finish processing before |
| 232 | // the proxy-close. The proxy-close in turn acts like a sync |
| 233 | // point, causing all commands (e.g. set-value!) to complete |
| 234 | // before the close takes effect. That is, it turns the close |
| 235 | // itself into a sync point. On a single-threaded socket, like |
| 236 | // the one used here for CogSimpleStorage, it's not really needed |
| 237 | // But I'm going to get paranoid about this, for now. |
| 238 | barrier(); |
| 231 | 239 | do_send("(cog-proxy-close)\n"); |
| 232 | 240 | do_recv(); |
| 233 | 241 | } |