fabric: Clean up mutex abstraction and atomic getter-setters in fi.h

The snippet in configure.ac which checked for intrinsics was
always failing so the atomic gcc intrinsics have never been
compiled. Additionally this set is deprecated as of GCC 4.7
which introduced a new set of intrinsics. Replace them
with test for the new c11 intrinsics + implementation,
tested on gcc 4.9.1.

Replaced the semaphore implementation of a mutex with a plain
old pthread mutex.  semaphore.h is part of posix/libc, just
like pthreads which we require explicitly-- so just use that.

Allow the mutex to be compile-time selected as either a mutex or a spinlock.

Signed-off-by: pmmccorm <patrick.m.mccormick@intel.com>
Signed-off-by: Sean Hefty <sean.hefty@intel.com>
usnic provider: suppress unused var warning

Fixes #265

Signed-off-by: Reese Faucette <rfaucett@cisco.com>
Merge pull request #267 from rfaucett/pr/nl_warn

usnic provider: suppress unused var warning
Merge pull request #266 from shefty/master

fabric: Clean up mutex abstraction and atomic getter-setters in fi.h
usnic: return 0 from eq_sread upon timeout

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
fi_eq: specify that sread returns 0 upon timeout

This seems to be the intended behavior, judging from the verbs and
sockets providers.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Merge pull request #268 from jsquyres/pr/man-fi-eq-timeout-updates

Clarify fi_eq.3 that fi_eq_sread() returns 0 upon timeout
Dlist with blocking FD
usdf_getinfo: only free addrinfo if actually allocated

Signed-off-by: Reese Faucette <rfaucett@cisco.com>
Merge pull request #271 from rfaucett/pr/usnic_freeai

usdf_getinfo: only free addrinfo if actually allocated
fi_eq.3: per #268, return -FI_ETIMEDOUT on timeout instead of 0.

Also specify that a negative timeout means an infinite timeout.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
usnic: return -FI_ETIMEDOUT from eq_sread upon timeout

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
sockets: return -FI_TIMEDOUT upon timeout, and honor inifite timeout

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
verbs: return -FI_TIMEDOUT upon timeout

Simplify the loop a bit by using while(1) and returning from directly
inside the loop.

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
usnic provider update, merge various recent changes

Signed-off-by: Reese Faucette <rfaucett@cisco.com>
Merge pull request #272 from rfaucett/pr/usnic_update

usnic provider update, merge various recent changes
Makefile.am: ensure to EXTRA_DIST distscript.pl

Signed-off-by: Jeff Squyres <jsquyres@cisco.com>
Merge pull request #273 from jsquyres/pr/make-distcheck-fix

Makefile.am: ensure to EXTRA_DIST distscript.pl
fi_dupinfo - jumping to fail with dup = NULL is bug, so much for
"future-proofing" !!

Signed-off-by: Reese Faucette <rfaucett@cisco.com>
fi_av_insert in async mode with no EQ specified should return -FI_ENOEQ,
not -FI_EINVAL

Signed-off-by: Reese Faucette <rfaucett@cisco.com>