Changeset 10464


Ignore:
Timestamp:
Aug 13, 2008, 10:42:45 PM (11 years ago)
Author:
gb
Message:

Call pthread_attr_destroy() on pthread_attr objects when done with
them. (Even though the pthread_attr objects are stack-allocated,
they may contain malloc'ed data when initialized.)

In destroy_semaphore(), free the malloc'ed semaphore in the
USE_POSIX_SEMAPHORES case (after calling sem_destroy().)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/source/lisp-kernel/thread_manager.c

    r10462 r10464  
    468468  pthread_getattr_np(p,&attr);
    469469  pthread_attr_getstack(&attr, base, size);
     470  pthread_attr_destroy(&attr);
    470471  *(natural *)base += *size;
    471472#endif
     
    482483  *base = (void *)((natural)temp_base + temp_size);
    483484  *size = temp_size;
     485  pthread_attr_destroy(&attr);
    484486#endif
    485487#ifdef SOLARIS
     
    549551#ifdef USE_POSIX_SEMAPHORES
    550552    sem_destroy((sem_t *)*s);
     553    free(*s);
    551554#endif
    552555#ifdef USE_MACH_SEMAPHORES
     
    12381241  */
    12391242  pthread_create(&returned_thread, &attr, start_routine, param);
     1243  pthread_attr_destroy(&attr);
    12401244  return (LispObj) ptr_to_lispobj(returned_thread);
    12411245}
Note: See TracChangeset for help on using the changeset viewer.