Print this page
5042 stop using deprecated atomic functions

Split Close
Expand all
Collapse all
          --- old/usr/src/uts/common/inet/tcp/tcp_input.c
          +++ new/usr/src/uts/common/inet/tcp/tcp_input.c
↓ open down ↓ 1931 lines elided ↑ open up ↑
1932 1932                   */
1933 1933  
1934 1934                  if (connp->conn_ref != 4 ||
1935 1935                      connp->conn_tcp->tcp_state != TCPS_LISTEN) {
1936 1936                          mutex_exit(&connp->conn_lock);
1937 1937                          mutex_exit(&connp->conn_fanout->connf_lock);
1938 1938                          goto done;
1939 1939                  }
1940 1940                  if (connp->conn_sqp != new_sqp) {
1941 1941                          while (connp->conn_sqp != new_sqp)
1942      -                                (void) casptr(&connp->conn_sqp, sqp, new_sqp);
     1942 +                                (void) atomic_cas_ptr(&connp->conn_sqp, sqp,
     1943 +                                    new_sqp);
1943 1944                          /* No special MT issues for outbound ixa_sqp hint */
1944 1945                          connp->conn_ixa->ixa_sqp = new_sqp;
1945 1946                  }
1946 1947  
1947 1948                  do {
1948 1949                          conn_flags = connp->conn_flags;
1949 1950                          conn_flags |= IPCL_FULLY_BOUND;
1950      -                        (void) cas32(&connp->conn_flags, connp->conn_flags,
1951      -                            conn_flags);
     1951 +                        (void) atomic_cas_32(&connp->conn_flags,
     1952 +                            connp->conn_flags, conn_flags);
1952 1953                  } while (!(connp->conn_flags & IPCL_FULLY_BOUND));
1953 1954  
1954 1955                  mutex_exit(&connp->conn_fanout->connf_lock);
1955 1956                  mutex_exit(&connp->conn_lock);
1956 1957  
1957 1958                  /*
1958 1959                   * Assume we have picked a good squeue for the listener. Make
1959 1960                   * subsequent SYNs not try to change the squeue.
1960 1961                   */
1961 1962                  connp->conn_recv = tcp_input_listener;
↓ open down ↓ 3860 lines elided ↑ open up ↑
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX