Print this page
5045 use atomic_{inc,dec}_* instead of atomic_add_*

@@ -1746,18 +1746,18 @@
                 /*
                  * Keep a count of current wput calls to start.
                  * Nonzero count delays any attempted DL_UNBIND.
                  * See comments above gld_start().
                  */
-                atomic_add_32((uint32_t *)&gld->gld_wput_count, 1);
+                atomic_inc_32((uint32_t *)&gld->gld_wput_count);
                 membar_enter();
 
                 /* Recheck state now wput_count is set to prevent DL_UNBIND */
                 /* If this Q is in process of DL_UNBIND, don't call start */
                 if (gld->gld_state != DL_IDLE || gld->gld_in_unbind) {
                         /* Extremely unlikely */
-                        atomic_add_32((uint32_t *)&gld->gld_wput_count, -1);
+                        atomic_dec_32((uint32_t *)&gld->gld_wput_count);
                         goto use_wsrv;
                 }
 
                 /*
                  * Get the priority value. Note that in raw mode, the

@@ -1769,11 +1769,11 @@
                 rc = (multidata) ? gld_start_mdt(q, mp, GLD_WPUT) :
                     gld_start(q, mp, GLD_WPUT, upri);
 
                 /* Allow DL_UNBIND again */
                 membar_exit();
-                atomic_add_32((uint32_t *)&gld->gld_wput_count, -1);
+                atomic_dec_32((uint32_t *)&gld->gld_wput_count);
 
                 if (rc == GLD_NORESOURCES)
                         qenable(q);
                 break;  /*  Done with this packet */