~peter-pearse/ubuntu/natty/guile-1.8/prop001

« back to all changes in this revision

Viewing changes to libguile/struct.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve Langasek
  • Date: 2009-06-04 19:01:38 UTC
  • mfrom: (8.1.1 sid)
  • Revision ID: james.westby@ubuntu.com-20090604190138-1ao3t6sj31cqvcfe
Tags: 1.8.6+1-1ubuntu1
* Merge from Debian unstable, remaining changes:
  - Build with -Wno-error.
  - Build with thread support. Some guile-using programs like autogen need it.
  - Add debian/guile-1.8-libs.shlibs: Thread support breaks ABI, bump the soname.
* Dropped changes:
  - libltdl3-dev -> libltdl7-dev: current libltdl-dev Provides: both.
  - debian/patches/libtool-ftbfs.diff: integrated upstream.

Show diffs side-by-side

added added

removed removed

Lines of Context:
16
16
 */
17
17
 
18
18
 
19
 
#if HAVE_CONFIG_H
 
19
#ifdef HAVE_CONFIG_H
20
20
#  include <config.h>
21
21
#endif
22
22
 
449
449
      if (! SCM_LAYOUT_TAILP (SCM_CHAR (last_char)))
450
450
        goto bad_tail;
451
451
    }
452
 
    
453
 
  SCM_CRITICAL_SECTION_START;
 
452
 
 
453
  /* In guile 1.8.5 and earlier, everything below was covered by a
 
454
     CRITICAL_SECTION lock.  This can lead to deadlocks in garbage
 
455
     collection, since other threads might be holding the heap_mutex, while
 
456
     sleeping on the CRITICAL_SECTION lock.  There does not seem to be any
 
457
     need for a lock on the section below, as it does not access or update
 
458
     any globals, so the critical section has been removed. */
 
459
 
454
460
  if (SCM_STRUCT_DATA (vtable)[scm_struct_i_flags] & SCM_STRUCTF_ENTITY)
455
461
    {
456
462
      data = scm_alloc_struct (basic_size + tail_elts,
466
472
  handle = scm_double_cell ((((scm_t_bits) SCM_STRUCT_DATA (vtable))
467
473
                             + scm_tc3_struct),
468
474
                            (scm_t_bits) data, 0, 0);
469
 
  SCM_CRITICAL_SECTION_END;
470
475
 
471
 
  /* In guile 1.8.1 and earlier, the SCM_CRITICAL_SECTION_END above covered
472
 
     also the following scm_struct_init.  But that meant if scm_struct_init
473
 
     finds an invalid type for a "u" field then there's an error throw in a
474
 
     critical section, which results in an abort().  Not sure if we need any
475
 
     protection across scm_struct_init.  The data array contains garbage at
476
 
     this point, but until we return it's not visible to anyone except
477
 
     `gc'.  */
478
476
  scm_struct_init (handle, layout, data, tail_elts, init);
479
477
 
480
478
  return handle;