• vasil's avatar
    branches/zip: · 94ea323e
    vasil authored
    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.
    94ea323e
univ.i 14.9 KB