~ubuntu-branches/ubuntu/raring/djvulibre/raring

« back to all changes in this revision

Viewing changes to libdjvu/GThreads.cpp

  • Committer: Package Import Robot
  • Author(s): Benjamin Drung
  • Date: 2010-11-17 16:03:21 UTC
  • mfrom: (1.1.7) (12.2.9 sid)
  • Revision ID: package-import@ubuntu.com-20101117160321-mp1qlaj5686tqe3g
Tags: 3.5.23-3ubuntu1
* Merge from Debian unstable.  Remaining changes:
  + Fix thumb2 porting issues; we suspect that the mov found during code
    review is not an active code path; adding compile time error
    #ifdef __thumb__ to ensure that its really not used in Ubuntu;
    Thanks for Dave Martin for this patch (LP: #513725)

Show diffs side-by-side

added added

removed removed

Lines of Context:
53
53
//C- | MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
54
54
//C- +------------------------------------------------------------------
55
55
// 
56
 
// $Id: GThreads.cpp,v 1.19 2007/03/25 20:48:32 leonb Exp $
57
 
// $Name: debian_version_3_5_22-9 $
 
56
// $Id: GThreads.cpp,v 1.22 2010/08/30 05:10:15 leonb Exp $
 
57
// $Name: debian_version_3_5_23-3 $
58
58
 
59
59
#ifdef HAVE_CONFIG_H
60
60
# include "config.h"
808
808
void 
809
809
GMonitor::leave()
810
810
{
 
811
  static pthread_t pthread_null;
811
812
  pthread_t self = pthread_self();
812
813
  if (ok && (count>0 || !pthread_equal(locker, self)))
813
814
    G_THROW( ERR_MSG("GThreads.not_acq_broad") );
815
816
  if (count > 0)
816
817
    {
817
818
      count = 1;
 
819
      locker = pthread_null;
818
820
      if (ok)
819
821
        pthread_mutex_unlock(&mutex);
820
822
    }
1009
1011
#error "This code needs some porting to work correctly in Thumb: https://wiki.ubuntu.com/ARM/Thumb2PortingHowto"
1010
1012
#endif
1011
1013
      char *sp = (char*)(((unsigned long)stackhi-16) & ~0xff);
1012
 
      asm volatile ("mov%?\t%|sp, %0\n\t" // set new stack pointer
1013
 
                    "mov%?\t%|pc, %1"     // branch to address %1
 
1014
      asm volatile ("mov %|sp, %0\n\t" // set new stack pointer
 
1015
# if defined(__ARM_ARCH_4__) || defined(__ARM_ARCH_4T__)
 
1016
                    "mov %|pc, %1"     // branch to address %1
 
1017
# else
 
1018
                    "bx %1"     // branch to address %1
 
1019
# endif
1014
1020
                    : : "r" (sp), "r" (pc) );
1015
1021
#else
1016
1022
#error "COTHREADS not supported on this machine."