001 package edu.rice.cs.cunit.record.syncPoints.thread;
002
003 import edu.rice.cs.cunit.record.graph.ThreadInfo;
004 import edu.rice.cs.cunit.record.syncPoints.ISyncPointVisitor;
005 import edu.rice.cs.cunit.instrumentors.DoNotInstrument;
006
007 /**
008 * Synchronization point corresponding to a Thread.exit call.
009 *
010 * @author Mathias Ricken
011 */
012 @DoNotInstrument
013 public class ThreadExitSyncPoint extends AThreadSyncPoint {
014 /**
015 * Constructor for this synchronization point.
016 * @param thread thread whose exit method was called.
017 */
018 public ThreadExitSyncPoint(Thread thread) {
019 super(thread);
020 }
021
022 /**
023 * Class for translated versions on the monitor side.
024 */
025 public static class Translated extends AThreadSyncPoint.Translated {
026 /**
027 * Constructor for translated version on the monitor side.
028 * @param threadInfo info about the thread
029 */
030 public Translated(ThreadInfo threadInfo) {
031 super(threadInfo);
032 }
033
034 /**
035 * Executes a visitor.
036 *
037 * @param visitor visitor to execute
038 * @param param visitor-specific parameter
039 *
040 * @return visitor-specific return value
041 */
042 public <R,P> R execute(ISyncPointVisitor<R, P> visitor, P param) {
043 return visitor.threadExitCase(this, param);
044 }
045 }
046 }