@@ -101,9 +101,6 @@ static pthread_cond_t cond_write;
101101/* Signalled when we are finished with everything. */
102102static pthread_cond_t cond_result ;
103103
104- /* Synchronize the start of all threads */
105- static maybe_thread_barrier_t start_barrier ;
106-
107104static int skip_first_line ;
108105
109106static void add_work (struct grep_opt * opt , struct grep_source * gs )
@@ -201,8 +198,6 @@ static void *run(void *arg)
201198 int hit = 0 ;
202199 struct grep_opt * opt = arg ;
203200
204- maybe_thread_barrier_wait (& start_barrier );
205-
206201 while (1 ) {
207202 struct work_item * w = get_work ();
208203 if (!w )
@@ -234,7 +229,6 @@ static void start_threads(struct grep_opt *opt)
234229 pthread_cond_init (& cond_add , NULL );
235230 pthread_cond_init (& cond_write , NULL );
236231 pthread_cond_init (& cond_result , NULL );
237- maybe_thread_barrier_init (& start_barrier , NULL , num_threads + 1 );
238232 grep_use_locks = 1 ;
239233 enable_obj_read_lock ();
240234
@@ -254,7 +248,6 @@ static void start_threads(struct grep_opt *opt)
254248 die (_ ("grep: failed to create thread: %s" ),
255249 strerror (err ));
256250 }
257- maybe_thread_barrier_wait (& start_barrier );
258251}
259252
260253static int wait_all (void )
@@ -291,7 +284,6 @@ static int wait_all(void)
291284 pthread_cond_destroy (& cond_add );
292285 pthread_cond_destroy (& cond_write );
293286 pthread_cond_destroy (& cond_result );
294- maybe_thread_barrier_destroy (& start_barrier );
295287 grep_use_locks = 0 ;
296288 disable_obj_read_lock ();
297289
0 commit comments