- //jsl_set_debug(2);
- // Comment out the next line to switch between the ordinary lock
- // server and the RSM. In Lab 6, we disable the lock server and
- // implement Paxos. In Lab 7, we will make the lock server use your
- // RSM layer.
-#define RSM
-#ifdef RSM
-// You must comment out the next line once you are done with Step One.
-//#define STEP_ONE
-#ifdef STEP_ONE
- rpcs server(atoi(argv[1]));
- lock_server_cache_rsm ls;
- server.reg(lock_protocol::acquire, &ls, &lock_server_cache_rsm::acquire);
- server.reg(lock_protocol::release, &ls, &lock_server_cache_rsm::release);
- server.reg(lock_protocol::stat, &ls, &lock_server_cache_rsm::stat);
-#else
- rsm rsm(argv[1], argv[2]);
- lock_server_cache_rsm ls(&rsm);
- rsm.set_state_transfer((rsm_state_transfer *)&ls);
- rsm.reg(lock_protocol::acquire, &ls, &lock_server_cache_rsm::acquire);
- rsm.reg(lock_protocol::release, &ls, &lock_server_cache_rsm::release);
- rsm.reg(lock_protocol::stat, &ls, &lock_server_cache_rsm::stat);
-#endif // STEP_ONE
-#endif // RSM