@@ -252,8 +252,7 @@ int AssignDollar(PHEAD WORD *term, WORD level)
252252*/
253253#ifdef WITHPTHREADS
254254 if ( dtype > 0 ) {
255- /* LOCK(d->pthreadslockwrite); */
256- LOCK (d -> pthreadslockread );
255+ LOCK (d -> pthreadslock );
257256NewValIsZero :;
258257 switch ( d -> type ) {
259258 case DOLZERO : goto NoChangeZero ;
@@ -278,8 +277,7 @@ NewValIsZero:;
278277 cbuf [AM .dbufnum ].NumTerms [numdollar ] = 0 ;
279278NoChangeZero :;
280279 CleanDollarFactors (d );
281- /* UNLOCK(d->pthreadslockwrite); */
282- UNLOCK (d -> pthreadslockread );
280+ UNLOCK (d -> pthreadslock );
283281 AN .ncmod = oldncmod ;
284282 return (0 );
285283 }
@@ -301,8 +299,7 @@ NoChangeZero:;
301299*/
302300#ifdef WITHPTHREADS
303301 if ( dtype > 0 ) {
304- /* LOCK(d->pthreadslockwrite); */
305- LOCK (d -> pthreadslockread );
302+ LOCK (d -> pthreadslock );
306303 if ( d -> size < MINALLOC ) {
307304 WORD oldsize , * oldwhere , i ;
308305 oldsize = d -> size ; oldwhere = d -> where ;
@@ -365,8 +362,7 @@ HandleDolZero:;
365362 cbuf [AM .dbufnum ].NumTerms [numdollar ] = 1 ;
366363NoChangeOne :;
367364 CleanDollarFactors (d );
368- /* UNLOCK(d->pthreadslockwrite); */
369- UNLOCK (d -> pthreadslockread );
365+ UNLOCK (d -> pthreadslock );
370366 AN .ncmod = oldncmod ;
371367 return (0 );
372368 }
@@ -398,7 +394,7 @@ NoChangeOne:;
398394 depends on the dollar variable.
399395*/
400396#ifdef WITHPTHREADS
401- LOCK (d -> pthreadslockread );
397+ LOCK (d -> pthreadslock );
402398#endif
403399 CleanDollarFactors (d );
404400/*
@@ -566,8 +562,7 @@ HandleDolZero1:;
566562 }
567563#ifdef WITHPTHREADS
568564NoChange :;
569- /* UNLOCK(d->pthreadslockwrite); */
570- UNLOCK (d -> pthreadslockread );
565+ UNLOCK (d -> pthreadslock );
571566#endif
572567 AN .ncmod = oldncmod ;
573568 return (0 );
@@ -1088,7 +1083,7 @@ WORD DolToTensor(PHEAD WORD numdollar)
10881083 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
10891084 }
10901085 else {
1091- LOCK (d -> pthreadslockread );
1086+ LOCK (d -> pthreadslock );
10921087 }
10931088 }
10941089 }
@@ -1122,7 +1117,7 @@ WORD DolToTensor(PHEAD WORD numdollar)
11221117 retval = 0 ;
11231118 }
11241119#ifdef WITHPTHREADS
1125- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
1120+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
11261121#endif
11271122 return (retval );
11281123}
@@ -1149,7 +1144,7 @@ WORD DolToFunction(PHEAD WORD numdollar)
11491144 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
11501145 }
11511146 else {
1152- LOCK (d -> pthreadslockread );
1147+ LOCK (d -> pthreadslock );
11531148 }
11541149 }
11551150 }
@@ -1179,7 +1174,7 @@ WORD DolToFunction(PHEAD WORD numdollar)
11791174 retval = 0 ;
11801175 }
11811176#ifdef WITHPTHREADS
1182- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
1177+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
11831178#endif
11841179 return (retval );
11851180}
@@ -1206,7 +1201,7 @@ WORD DolToVector(PHEAD WORD numdollar)
12061201 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
12071202 }
12081203 else {
1209- LOCK (d -> pthreadslockread );
1204+ LOCK (d -> pthreadslock );
12101205 }
12111206 }
12121207 }
@@ -1243,7 +1238,7 @@ WORD DolToVector(PHEAD WORD numdollar)
12431238 retval = 0 ;
12441239 }
12451240#ifdef WITHPTHREADS
1246- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
1241+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
12471242#endif
12481243 return (retval );
12491244}
@@ -1329,7 +1324,7 @@ WORD DolToSymbol(PHEAD WORD numdollar)
13291324 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
13301325 }
13311326 else {
1332- LOCK (d -> pthreadslockread );
1327+ LOCK (d -> pthreadslock );
13331328 }
13341329 }
13351330 }
@@ -1356,7 +1351,7 @@ WORD DolToSymbol(PHEAD WORD numdollar)
13561351 retval = -1 ;
13571352 }
13581353#ifdef WITHPTHREADS
1359- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
1354+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
13601355#endif
13611356 return (retval );
13621357}
@@ -1383,7 +1378,7 @@ WORD DolToIndex(PHEAD WORD numdollar)
13831378 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
13841379 }
13851380 else {
1386- LOCK (d -> pthreadslockread );
1381+ LOCK (d -> pthreadslock );
13871382 }
13881383 }
13891384 }
@@ -1432,7 +1427,7 @@ WORD DolToIndex(PHEAD WORD numdollar)
14321427 retval = 0 ;
14331428 }
14341429#ifdef WITHPTHREADS
1435- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
1430+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
14361431#endif
14371432 return (retval );
14381433}
@@ -1571,8 +1566,7 @@ DOLLARS DolToTerms(PHEAD WORD numdollar)
15711566 newd -> size = size ;
15721567 newd -> numdummies = d -> numdummies ;
15731568#ifdef WITHPTHREADS
1574- newd -> pthreadslockread = dummylock ;
1575- newd -> pthreadslockwrite = dummylock ;
1569+ newd -> pthreadslock = dummylock ;
15761570#endif
15771571 size ++ ;
15781572 NCOPY (t ,w ,size );
@@ -1763,8 +1757,7 @@ int InsideDollar(PHEAD WORD *ll, WORD level)
17631757 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
17641758 }
17651759 else {
1766- /* LOCK(d->pthreadslockwrite); */
1767- LOCK (d -> pthreadslockread );
1760+ LOCK (d -> pthreadslock );
17681761 }
17691762 }
17701763 }
@@ -1817,8 +1810,7 @@ int InsideDollar(PHEAD WORD *ll, WORD level)
18171810*/
18181811#ifdef WITHPTHREADS
18191812 if ( dtype > 0 && dtype != MODLOCAL ) {
1820- /* UNLOCK(d->pthreadslockwrite); */
1821- UNLOCK (d -> pthreadslockread );
1813+ UNLOCK (d -> pthreadslock );
18221814 }
18231815#endif
18241816 if ( newd -> factors ) M_free (newd -> factors ,"Dollar factors" );
@@ -1874,7 +1866,7 @@ LONG TermsInDollar(WORD num)
18741866 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
18751867 }
18761868 else {
1877- LOCK (d -> pthreadslockread );
1869+ LOCK (d -> pthreadslock );
18781870 }
18791871 }
18801872 }
@@ -1895,7 +1887,7 @@ LONG TermsInDollar(WORD num)
18951887 else if ( d -> type == DOLZERO ) n = 0 ;
18961888 else n = 1 ;
18971889#ifdef WITHPTHREADS
1898- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
1890+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
18991891#endif
19001892 return (n );
19011893}
@@ -1923,7 +1915,7 @@ LONG SizeOfDollar(WORD num)
19231915 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
19241916 }
19251917 else {
1926- LOCK (d -> pthreadslockread );
1918+ LOCK (d -> pthreadslock );
19271919 }
19281920 }
19291921 }
@@ -1947,7 +1939,7 @@ LONG SizeOfDollar(WORD num)
19471939 else if ( d -> type == DOLZERO ) n = 0 ;
19481940 else n = 1 ;
19491941#ifdef WITHPTHREADS
1950- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
1942+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
19511943#endif
19521944 return (n );
19531945}
@@ -2974,14 +2966,14 @@ int DollarFactorize(PHEAD WORD numdollar)
29742966 d = ModOptdollars [nummodopt ].dstruct + AT .identity ;
29752967 }
29762968 else {
2977- LOCK (d -> pthreadslockread );
2969+ LOCK (d -> pthreadslock );
29782970 }
29792971 }
29802972 }
29812973#endif
29822974 CleanDollarFactors (d );
29832975#ifdef WITHPTHREADS
2984- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
2976+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
29852977#endif
29862978 if ( d -> type != DOLTERMS ) { /* only one term */
29872979 if ( d -> type != DOLZERO ) d -> nfactors = 1 ;
@@ -3231,13 +3223,13 @@ int DollarFactorize(PHEAD WORD numdollar)
32313223 Be careful: there should be more than one factor now.
32323224*/
32333225#ifdef WITHPTHREADS
3234- if ( dtype > 0 && dtype != MODLOCAL ) { LOCK (d -> pthreadslockread ); }
3226+ if ( dtype > 0 && dtype != MODLOCAL ) { LOCK (d -> pthreadslock ); }
32353227#endif
32363228 if ( nfactors == 1 && extrafactor == 0 ) { /* we can use the buf1 contents */
32373229 if ( factorsincontent == 0 ) {
32383230 d -> nfactors = 1 ;
32393231#ifdef WITHPTHREADS
3240- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
3232+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
32413233#endif
32423234/*
32433235 We used here (before 3-sep-2015) the original and did not make
@@ -3289,7 +3281,7 @@ getout2: AR.SortType = oldsorttype;
32893281 M_free (d -> factors ,"factors in dollar" );
32903282 d -> factors = 0 ;
32913283#ifdef WITHPTHREADS
3292- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
3284+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
32933285#endif
32943286 M_free (buf3 ,"DollarFactorize-4" );
32953287 if ( buf2 != buf1 && buf2 ) M_free (buf2 ,"DollarFactorize-4" );
@@ -3533,7 +3525,7 @@ nextj:;
35333525 #] Step 8:
35343526*/
35353527#ifdef WITHPTHREADS
3536- if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslockread ); }
3528+ if ( dtype > 0 && dtype != MODLOCAL ) { UNLOCK (d -> pthreadslock ); }
35373529#endif
35383530 return (0 );
35393531}
0 commit comments