~n-muench/ubuntu/precise/open-vm-tools/open-vm-tools.raring-precise.backport

« back to all changes in this revision

Viewing changes to lib/lock/ulCondVar.c

  • Committer: Package Import Robot
  • Author(s): Nate Muench
  • Date: 2012-01-23 16:09:45 UTC
  • mfrom: (1.4.6) (2.4.26 sid)
  • Revision ID: package-import@ubuntu.com-20120123160945-b6s0r1vkcovucpf3
Tags: 2011.12.20-562307-0ubuntu1
* Merge latest upstream git tag. Fixes building on Precise
  (LP: #898289, LP: #905612)

* Items merged from Debian unstable:
  - debian/control:
    + open-vm-tools recommends open-vm-dkms. (LP: #598933)
    + open-vm-tools now suggests open-vm-toolbox. (LP: #604998)
  (From 2011.08.21-471295-1 release)
  - Updating maintainer and uploaders fields.
  - Removing vcs fields.
  - Removing references to Daniel's old email address.
  - Updating years in copyright file.
  - Updating to standards version 3.9.2.
  - Updating to debhelper version 8.
  - Switching to source format 3.0 (quilt).
  - Removing manual chrpath setting.
  - Removing exclusion from plugins from debhelper shlibs.
  - Rediffing kvers.patch.
  (From 2011.09.23-491607-1 release)
  - Marking binary architecture-dependend packages as linux and kfreebsd
  only.
  - Removing liburiparser-dev from build-depends as upstream dropped
  unity support.
  - Building with libproc-dev on amd64 again.
  - Dropping disabling of dnet support.
  (From 2011.09.23-491607-2 release)
  - Adding doxygen to build-depends for api documentation.
  - Adding libcunit1-dev to build-depends for test suites.
  - Minimizing rules file.
  - Adding open-vm-tools-dev package, containing only the api
    documentation for now.
  (From 2011.09.23-491607-3 release)
  - Sorting overrides in rules alphabetically.
  - Compacting copyright file.
  - Adding udev rule to set timeout for vmware scsi devices
  (From 2011.12.20-562307-1 release)
  - Adding patch to correct typo in upstreams dkms configuration

* Remaining Changes:
  - Remove Stable part of version numbering.
  - debian folder:
    + Re-added open-vm-dkms.postinst & open-vm-dkms.prerm.
      * Allows dkms modules to compile upon installation.
  - debian/control:
    + Re-add open-vm-source and make into a transitional package
      for open-vm-toolbox.
    + Return dependancies that were moved to open-vm-tools back to
      open-vm-toolbox.
  - debian/rules and debian/open-vm-toolbox.lintian-overrides:
    + Make vmware-user-suid-wrapper suid-root
  - debian/rules:
    + Added CFLAGS field with -Wno-deprecated-declarations
      * Will suppress issues with glib 2.31 or later.
    + Add line to copy vmware-xdg-detect-de into place.
    + Install vmware-user.desktop through toolbox package.
  - debian/open-vm-tools.init:
    + Re-add 'modprobe [-r] vmblock'.
    + Add 'modprobe [-r] vmxnet'.
      * Incase it's not loaded during boot.
    + Remove and re-add pcnet32 module
      * Will be done before (remove) and after (readd) vmxnet module
        is added.
      * If vmxnet doesn't exist (aka modules fail to build), pcnet32 can be
        still used for network connectivity.
      * Workaround until a better fix can be done.
  - Re-add gnome-session to debian/local/xautostart.conf
  - Manpages removed (from debian/manpages):
    + vmmemctl.9
    + vmxnet3.9
    + Remove references to manpages that have been removed.

Show diffs side-by-side

added added

removed removed

Lines of Context:
55
55
#endif
56
56
};
57
57
 
58
 
#define MXUSER_CONDVAR_SIGNATURE 0x444E4F43 // 'COND' in memory
59
 
 
60
58
#if defined(_WIN32)
61
59
typedef VOID (WINAPI *InitializeConditionVariableFn)(PCONDITION_VARIABLE cv);
62
60
typedef BOOL (WINAPI *SleepConditionVariableCSFn)(PCONDITION_VARIABLE cv,
306
304
      MXRecLockIncCount(lock, lockCount - 1);
307
305
 
308
306
      if (err != ERROR_SUCCESS) {
309
 
         Panic("%s: failure %d on condVar (%p; %s)\n", __FUNCTION__, err,
 
307
         Panic("%s: failure %d on condVar (0x%p; %s)\n", __FUNCTION__, err,
310
308
               condVar, condVar->header->name);
311
309
      }
312
310
   }
505
503
 
506
504
   if (err != 0) {
507
505
      if (err != ETIMEDOUT) {
508
 
         Panic("%s: failure %d on condVar (%p; %s)\n", __FUNCTION__, err,
 
506
         Panic("%s: failure %d on condVar (0x%p; %s)\n", __FUNCTION__, err,
509
507
               condVar, condVar->header->name);
510
508
      }
511
509
   }
589
587
   MXUserCondVar *condVar = Util_SafeCalloc(1, sizeof(*condVar));
590
588
 
591
589
   if (MXUserCreateInternal(condVar)) {
592
 
      condVar->signature = MXUSER_CONDVAR_SIGNATURE;
 
590
      condVar->signature = MXUserGetSignature(MXUSER_TYPE_CONDVAR);
593
591
      condVar->header = header;
594
592
      condVar->ownerLock = lock;
595
593
   } else {
626
624
{
627
625
   ASSERT(header);
628
626
   ASSERT(lock);
629
 
   ASSERT(condVar && (condVar->signature == MXUSER_CONDVAR_SIGNATURE));
 
627
   ASSERT(condVar);
 
628
   ASSERT(condVar->signature == MXUserGetSignature(MXUSER_TYPE_CONDVAR));
630
629
 
631
630
   if (condVar->ownerLock != lock) {
632
 
      Panic("%s: invalid use of lock %s with condVar (%p; %s)\n",
 
631
      Panic("%s: invalid use of lock %s with condVar (0x%p; %s)\n",
633
632
             __FUNCTION__, header->name, condVar, condVar->header->name);
634
633
   }
635
634
 
636
635
   if (!MXRecLockIsOwner(lock)) {
637
 
      Panic("%s: lock %s for condVar (%p) not owned\n",
 
636
      Panic("%s: lock %s for condVar (0x%p) not owned\n",
638
637
            __FUNCTION__, condVar->header->name, condVar);
639
638
   }
640
639
 
666
665
{
667
666
   int err;
668
667
 
669
 
   ASSERT(condVar && (condVar->signature == MXUSER_CONDVAR_SIGNATURE));
 
668
   ASSERT(condVar);
 
669
   ASSERT(condVar->signature == MXUserGetSignature(MXUSER_TYPE_CONDVAR));
670
670
 
671
671
   err = MXUserSignalInternal(condVar);
672
672
 
673
673
   if (err != 0) {
674
 
      Panic("%s: failure %d on condVar (%p; %s) \n", __FUNCTION__, err,
 
674
      Panic("%s: failure %d on condVar (0x%p; %s) \n", __FUNCTION__, err,
675
675
            condVar, condVar->header->name);
676
676
   }
677
677
}
699
699
{
700
700
   int err;
701
701
 
702
 
   ASSERT(condVar && (condVar->signature == MXUSER_CONDVAR_SIGNATURE));
 
702
   ASSERT(condVar);
 
703
   ASSERT(condVar->signature == MXUserGetSignature(MXUSER_TYPE_CONDVAR));
703
704
 
704
705
   err = MXUserBroadcastInternal(condVar);
705
706
 
706
707
   if (err != 0) {
707
 
      Panic("%s: failure %d on condVar (%p; %s) \n", __FUNCTION__, err,
 
708
      Panic("%s: failure %d on condVar (0x%p; %s) \n", __FUNCTION__, err,
708
709
            condVar, condVar->header->name);
709
710
   }
710
711
}
732
733
MXUser_DestroyCondVar(MXUserCondVar *condVar)  // IN:
733
734
{
734
735
   if (condVar != NULL) {
735
 
      ASSERT(condVar && (condVar->signature == MXUSER_CONDVAR_SIGNATURE));
 
736
      ASSERT(condVar->signature == MXUserGetSignature(MXUSER_TYPE_CONDVAR));
736
737
 
737
738
      if (Atomic_Read(&condVar->referenceCount) != 0) {
738
 
         Panic("%s: Attempted destroy on active condVar (%p; %s)\n",
 
739
         Panic("%s: Attempted destroy on active condVar (0x%p; %s)\n",
739
740
               __FUNCTION__, condVar, condVar->header->name);
740
741
      }
741
742
 
 
743
      condVar->signature = 0;  // just in case...
 
744
 
742
745
      MXUserDestroyInternal(condVar);
743
746
 
744
 
      condVar->signature = 0;  // just in case...
745
747
      condVar->header = NULL;
746
748
      condVar->ownerLock = NULL;
747
749