@@ -85,22 +85,10 @@ static inline void instrumentation_thread_init() {
8585 std::exit (EXIT_FAILURE);
8686 }
8787
88- pid_t this_tid = syscall (SYS_gettid);
89-
90- for (const auto &tid : tracrThreadIDs) {
91- if (this_tid == tid) {
92- std::cerr << " TraCR thread with this TID already exists in the list in "
93- " tracr proc\n " ;
94- std::exit (EXIT_FAILURE);
95- }
96- }
97-
9888 // Add tracr Thread
89+ pid_t this_tid = syscall (SYS_gettid);
9990 tracrThread = std::make_unique<TraCRThread>(this_tid);
10091
101- // Add the new TraCR Thread
102- addTraCRThread (this_tid);
103-
10492 // Increase global thread counter
10593 ++num_tracr_threads;
10694}
@@ -123,10 +111,6 @@ static inline void instrumentation_thread_finalize() {
123111 // Finalize the thread now (destructor of it is also called)
124112 tracrThread.reset ();
125113
126- // If it exists check if it is inside the tracr proc list
127- // If yes, erase it, else abort
128- eraseTraCRThread (syscall (SYS_gettid));
129-
130114 // Decrease global thread counter
131115 --num_tracr_threads;
132116}
@@ -180,10 +164,9 @@ static inline void instrumentation_end() {
180164
181165 // Flushing the trace of this TraCR thread/proc now (if enabled)
182166 if (flush_enabled) {
183- if (num_tracr_threads.load () != 1 || tracrThreadIDs. size () != 1 ) {
167+ if (num_tracr_threads.load () != 1 ) {
184168 std::cerr << " Only one(this) TraCR Threads allowed but got: "
185- << num_tracr_threads.load () << " :" << tracrThreadIDs.size ()
186- << " \n " ;
169+ << num_tracr_threads.load () << " \n " ;
187170 std::exit (EXIT_FAILURE);
188171 }
189172
@@ -197,10 +180,6 @@ static inline void instrumentation_end() {
197180 // Destroys the TraCR Thread pointer and calls the destructor
198181 tracrThread.reset ();
199182
200- // If it exists check if it is inside the tracr proc list
201- // If yes, erase it, else abort
202- eraseTraCRThread (syscall (SYS_gettid));
203-
204183 // Decrease global thread counter
205184 --num_tracr_threads;
206185
0 commit comments