20d2f29ca6491f11c70c95e041220fe72c37a2dd
galt
  Sun Dec 22 15:06:45 2024 -0800
fix compiler warning about about restrict keywords in pthread_create.

diff --git src/hg/hgTracks/hgTracks.c src/hg/hgTracks/hgTracks.c
index f601c0c..328225b 100644
--- src/hg/hgTracks/hgTracks.c
+++ src/hg/hgTracks/hgTracks.c
@@ -7876,38 +7876,34 @@
 
     // insert resulting entries into track->decorators, leaving room for having multiple sources applied
     // to the same track in the future.
     if (track->decoratorGroup == NULL)
         track->decoratorGroup = newDecoratorGroup();
 
     struct decorator* newDecorators = decoratorListFromBbi(decoratorTdb, chromName, result, filters, bbi, mouseScheme);
     track->decoratorGroup->decorators = slCat(track->decoratorGroup->decorators, newDecorators);
     for (struct decorator *d = track->decoratorGroup->decorators; d != NULL; d = d->next)
         d->group = track->decoratorGroup;
     lmCleanup(&lm);
     bigBedFileClose(&bbi);
     }
 }
 
-static void *remoteParallelLoad(void *threadParam)
+static void *remoteParallelLoad()
 /* Each thread loads tracks in parallel until all work is done. */
 {
-pthread_t *pthread = threadParam;
 struct paraFetchData *pfd = NULL;
-pthread_detach(*pthread);  // this thread will never join back with it's progenitor
-    // Canceled threads that might leave locks behind,
-    // so the theads are detached and will be neither joined nor canceled.
 boolean allDone = FALSE;
 while(1)
     {
     pthread_mutex_lock( &pfdMutex );
     if (!pfdList)
 	{
 	allDone = TRUE;
 	}
     else
 	{  // move it from the waiting queue to the running queue
 	pfd = slPopHead(&pfdList);
 	slAddHead(&pfdRunning, pfd);
         }
     pthread_mutex_unlock( &pfdMutex );
     if (allDone)
@@ -8872,35 +8868,38 @@
     int pfdListCount = 0;
     pthread_t *threads = NULL;
     if (ptMax > 0)     // parallelFetch.threads=0 to disable parallel fetch
 	{
 	findLeavesForParallelLoad(trackList, &pfdList);
 	pfdListCount = slCount(pfdList);
 	/* launch parallel threads */
 	ptMax = min(ptMax, pfdListCount);
 	if (ptMax > 0)
 	    {
 	    AllocArray(threads, ptMax);
 	    /* Create threads */
 	    int pt;
 	    for (pt = 0; pt < ptMax; ++pt)
 		{
-		int rc = pthread_create(&threads[pt], NULL, remoteParallelLoad, &threads[pt]);
+		int rc = pthread_create(&threads[pt], NULL, remoteParallelLoad, NULL);
 		if (rc)
 		    {
 		    errAbort("Unexpected error %d from pthread_create(): %s",rc,strerror(rc));
 		    }
+		pthread_detach(threads[pt]);  // this thread will never join back with it's progenitor
+		    // Canceled threads that might leave locks behind,
+		    // so the theads are detached and will be neither joined nor canceled.
 		}
 	    }
 	}
 
     // TODO GALT
     /* load regular tracks */
     for (track = trackList; track != NULL; track = track->next)
 	{
 	if (track->visibility != tvHide)
 	    {
             if (!track->parallelLoading)
 		{
 		if (measureTiming)
 		    lastTime = clock1000();