예제 #1
0
        /* Returns the value of the PadInt when the transaction
         *  has the read/write lock.
         * Throw an exception if PadInt not found.
         */
        internal override int ReadPadInt(int tid, int uid)
        {
            Logger.Log(new String[] { "FreezedServer", Server.ID.ToString(), "readPadInt ", "tid", tid.ToString(), "uid", uid.ToString() });
            int result;

            lock (this) {
                while (!recover)
                {
                    Monitor.Wait(this);
                }
                result = oldState.ReadPadInt(tid, uid);
                Monitor.Pulse(this);
            }
            return(result);
        }
예제 #2
0
        /* Returns the value of the PadInt when the transaction
         *  has the read/write lock.
         * Throw an exception if PadInt not found.
         */
        public int ReadPadInt(int tid, int uid)
        {
            Logger.Log(new String[] { "Server", ID.ToString(), "readPadInt ", "tid", tid.ToString(), "uid", uid.ToString(), serverState.StateMsg });

            try {
                return(serverState.ReadPadInt(tid, uid));
            }
            catch (PadIntNotFoundException) {
                throw;
            }
            catch (AbortException) {
                throw;
            }
            catch (ServerDoesNotReplyException) {
                throw;
            }
        }