Commit 4283c77b authored by vasil's avatar vasil

branches/zip:

Add FreeBSD to the list of the operating systems that have
sizeof(pthread_t) == sizeof(void*) (i.e. word size).

On FreeBSD pthread_t is defined like:

  /usr/include/sys/_pthreadtypes.h:

  typedef struct  pthread                 *pthread_t;

I did the following tests (per Inaam's recommendation):

a) appropriate version of GCC is available on that platform (4.1.2 or
higher for atomics to be available)

  On FreeBSD 6.x the default compiler is 3.4.6, on FreeBSD 7.x the default
  one is 4.2.1. One can always install the version of choice from the ports
  collection. If gcc 3.x is used then HAVE_GCC_ATOMIC_BUILTINS will not be
  defined and thus the change I am committing will make no difference.

b) find out if sizeof(pthread_t) == sizeof(long)

  On 32 bit both are 4 bytes, on 64 bit both are 8 bytes.

c) find out the compiler generated platform define (e.g.: __aix, __sunos__
etc.)

  The macro is __FreeBSD__.

d) patch univ.i with the appropriate platform define
e) build the mysql
f) ensure it is using atomic builtins (look at the err.log message at
system startup. It should say we are using atomics for both mutexes and
rw-locks)
g) do sanity testing (keeping in view the smp changes)

  I ran the mysql-test suite. All tests pass.
parent 7c180f1d
......@@ -116,7 +116,8 @@ of the 32-bit x86 assembler in mutex operations. */
/* For InnoDB rw_locks to work with atomics we need the thread_id
to be no more than machine word wide. The following enables using
atomics for InnoDB rw_locks where these conditions are met. */
# if defined(HAVE_GCC_ATOMIC_BUILTINS) && defined(__linux__)
# if defined(HAVE_GCC_ATOMIC_BUILTINS) && (defined(__linux__) \
|| defined(__FreeBSD__))
# define INNODB_RW_LOCKS_USE_ATOMICS
# endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment