cmake HAVE_IB_LINUX_FUTEX examples

percona/percona-server storage/innobase/innodb.cmake :194

CHECK_C_SOURCE_RUNS(
  "
  #include <stdio.h>
  #include <unistd.h>
  #include <errno.h>
  #include <assert.h>
  #include <linux/futex.h>
  #include <unistd.h>
  #include <sys/syscall.h>

   int futex_wait(int* futex, int v) {
        return(syscall(SYS_futex, futex, FUTEX_WAIT_PRIVATE, v, NULL, NULL, 0));
   }

   int futex_signal(int* futex) {
        return(syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0));
   }

  int main() {
        int     ret;
        int     m = 1;

        /* It is setup to fail and return EWOULDBLOCK. */
        ret = futex_wait(&m, 0);
        assert(ret == -1 && errno == EWOULDBLOCK);
        /* Shouldn't wake up any threads. */
        assert(futex_signal(&m) == 0);

        return(0);
  }"
  HAVE_IB_LINUX_FUTEX)

percona/percona-server storage/innobase/innodb.cmake :227

ADD_DEFINITIONS(-DHAVE_IB_LINUX_FUTEX=1)

percona/percona-server storage/innobase/innodb.cmake :255

ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)

logicalclocks/rondb storage/innobase/innodb.cmake :194

CHECK_C_SOURCE_RUNS(
  "
  #include <stdio.h>
  #include <unistd.h>
  #include <errno.h>
  #include <assert.h>
  #include <linux/futex.h>
  #include <unistd.h>
  #include <sys/syscall.h>

   int futex_wait(int* futex, int v) {
        return(syscall(SYS_futex, futex, FUTEX_WAIT_PRIVATE, v, NULL, NULL, 0));
   }

   int futex_signal(int* futex) {
        return(syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0));
   }

  int main() {
        int     ret;
        int     m = 1;

        /* It is setup to fail and return EWOULDBLOCK. */
        ret = futex_wait(&m, 0);
        assert(ret == -1 && errno == EWOULDBLOCK);
        /* Shouldn't wake up any threads. */
        assert(futex_signal(&m) == 0);

        return(0);
  }"
  HAVE_IB_LINUX_FUTEX)

logicalclocks/rondb storage/innobase/innodb.cmake :227

ADD_DEFINITIONS(-DHAVE_IB_LINUX_FUTEX=1)

logicalclocks/rondb storage/innobase/innodb.cmake :255

ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)

polardb/polardbx-engine storage/innobase/innodb.cmake :201

CHECK_C_SOURCE_RUNS(
  "
  #include <stdio.h>
  #include <unistd.h>
  #include <errno.h>
  #include <assert.h>
  #include <linux/futex.h>
  #include <unistd.h>
  #include <sys/syscall.h>

   int futex_wait(int* futex, int v) {
        return(syscall(SYS_futex, futex, FUTEX_WAIT_PRIVATE, v, NULL, NULL, 0));
   }

   int futex_signal(int* futex) {
        return(syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0));
   }

  int main() {
        int     ret;
        int     m = 1;

        /* It is setup to fail and return EWOULDBLOCK. */
        ret = futex_wait(&m, 0);
        assert(ret == -1 && errno == EWOULDBLOCK);
        /* Shouldn't wake up any threads. */
        assert(futex_signal(&m) == 0);

        return(0);
  }"
  HAVE_IB_LINUX_FUTEX)

polardb/polardbx-engine storage/innobase/innodb.cmake :234

ADD_DEFINITIONS(-DHAVE_IB_LINUX_FUTEX=1)

polardb/polardbx-engine storage/innobase/innodb.cmake :262

ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)

percona/percona-xtrabackup storage/innobase/innodb.cmake :194

CHECK_C_SOURCE_RUNS(
  "
  #include <stdio.h>
  #include <unistd.h>
  #include <errno.h>
  #include <assert.h>
  #include <linux/futex.h>
  #include <unistd.h>
  #include <sys/syscall.h>

   int futex_wait(int* futex, int v) {
        return(syscall(SYS_futex, futex, FUTEX_WAIT_PRIVATE, v, NULL, NULL, 0));
   }

   int futex_signal(int* futex) {
        return(syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0));
   }

  int main() {
        int     ret;
        int     m = 1;

        /* It is setup to fail and return EWOULDBLOCK. */
        ret = futex_wait(&m, 0);
        assert(ret == -1 && errno == EWOULDBLOCK);
        /* Shouldn't wake up any threads. */
        assert(futex_signal(&m) == 0);

        return(0);
  }"
  HAVE_IB_LINUX_FUTEX)

percona/percona-xtrabackup storage/innobase/innodb.cmake :227

ADD_DEFINITIONS(-DHAVE_IB_LINUX_FUTEX=1)

percona/percona-xtrabackup storage/innobase/innodb.cmake :255

ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)

GreatSQL/GreatSQL storage/innobase/innodb.cmake :195

CHECK_C_SOURCE_RUNS(
  "
  #include <stdio.h>
  #include <unistd.h>
  #include <errno.h>
  #include <assert.h>
  #include <linux/futex.h>
  #include <unistd.h>
  #include <sys/syscall.h>

   int futex_wait(int* futex, int v) {
        return(syscall(SYS_futex, futex, FUTEX_WAIT_PRIVATE, v, NULL, NULL, 0));
   }

   int futex_signal(int* futex) {
        return(syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0));
   }

  int main() {
        int     ret;
        int     m = 1;

        /* It is setup to fail and return EWOULDBLOCK. */
        ret = futex_wait(&m, 0);
        assert(ret == -1 && errno == EWOULDBLOCK);
        /* Shouldn't wake up any threads. */
        assert(futex_signal(&m) == 0);

        return(0);
  }"
  HAVE_IB_LINUX_FUTEX)

GreatSQL/GreatSQL storage/innobase/innodb.cmake :228

ADD_DEFINITIONS(-DHAVE_IB_LINUX_FUTEX=1)

GreatSQL/GreatSQL storage/innobase/innodb.cmake :256

ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)

percona/percona-xtradb-cluster storage/innobase/innodb.cmake :194

CHECK_C_SOURCE_RUNS(
  "
  #include <stdio.h>
  #include <unistd.h>
  #include <errno.h>
  #include <assert.h>
  #include <linux/futex.h>
  #include <unistd.h>
  #include <sys/syscall.h>

   int futex_wait(int* futex, int v) {
        return(syscall(SYS_futex, futex, FUTEX_WAIT_PRIVATE, v, NULL, NULL, 0));
   }

   int futex_signal(int* futex) {
        return(syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0));
   }

  int main() {
        int     ret;
        int     m = 1;

        /* It is setup to fail and return EWOULDBLOCK. */
        ret = futex_wait(&m, 0);
        assert(ret == -1 && errno == EWOULDBLOCK);
        /* Shouldn't wake up any threads. */
        assert(futex_signal(&m) == 0);

        return(0);
  }"
  HAVE_IB_LINUX_FUTEX)

percona/percona-xtradb-cluster storage/innobase/innodb.cmake :227

ADD_DEFINITIONS(-DHAVE_IB_LINUX_FUTEX=1)

percona/percona-xtradb-cluster storage/innobase/innodb.cmake :255

ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)

facebook/mysql-5.6 storage/innobase/innodb.cmake :195

CHECK_C_SOURCE_RUNS(
  "
  #include <stdio.h>
  #include <unistd.h>
  #include <errno.h>
  #include <assert.h>
  #include <linux/futex.h>
  #include <unistd.h>
  #include <sys/syscall.h>

   int futex_wait(int* futex, int v) {
        return(syscall(SYS_futex, futex, FUTEX_WAIT_PRIVATE, v, NULL, NULL, 0));
   }

   int futex_signal(int* futex) {
        return(syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0));
   }

  int main() {
        int     ret;
        int     m = 1;

        /* It is setup to fail and return EWOULDBLOCK. */
        ret = futex_wait(&m, 0);
        assert(ret == -1 && errno == EWOULDBLOCK);
        /* Shouldn't wake up any threads. */
        assert(futex_signal(&m) == 0);

        return(0);
  }"
  HAVE_IB_LINUX_FUTEX)

facebook/mysql-5.6 storage/innobase/innodb.cmake :228

ADD_DEFINITIONS(-DHAVE_IB_LINUX_FUTEX=1)

facebook/mysql-5.6 storage/innobase/innodb.cmake :256

ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)

mysql/mysql-server storage/innobase/innodb.cmake :194

CHECK_C_SOURCE_RUNS(
  "
  #include <stdio.h>
  #include <unistd.h>
  #include <errno.h>
  #include <assert.h>
  #include <linux/futex.h>
  #include <unistd.h>
  #include <sys/syscall.h>

   int futex_wait(int* futex, int v) {
        return(syscall(SYS_futex, futex, FUTEX_WAIT_PRIVATE, v, NULL, NULL, 0));
   }

   int futex_signal(int* futex) {
        return(syscall(SYS_futex, futex, FUTEX_WAKE, 1, NULL, NULL, 0));
   }

  int main() {
        int     ret;
        int     m = 1;

        /* It is setup to fail and return EWOULDBLOCK. */
        ret = futex_wait(&m, 0);
        assert(ret == -1 && errno == EWOULDBLOCK);
        /* Shouldn't wake up any threads. */
        assert(futex_signal(&m) == 0);

        return(0);
  }"
  HAVE_IB_LINUX_FUTEX)

mysql/mysql-server storage/innobase/innodb.cmake :227

ADD_DEFINITIONS(-DHAVE_IB_LINUX_FUTEX=1)

mysql/mysql-server storage/innobase/innodb.cmake :255

ELSEIF(MUTEXTYPE MATCHES "futex" AND DEFINED HAVE_IB_LINUX_FUTEX)