From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from pigeon.gentoo.org ([208.92.234.80] helo=lists.gentoo.org) by finch.gentoo.org with esmtp (Exim 4.60) (envelope-from ) id 1SkEml-0006zI-Hk for garchives@archives.gentoo.org; Thu, 28 Jun 2012 13:29:27 +0000 Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 97A37E01F1; Thu, 28 Jun 2012 13:29:05 +0000 (UTC) Received: from smtp.gentoo.org (smtp.gentoo.org [140.211.166.183]) by pigeon.gentoo.org (Postfix) with ESMTP id 67360E01F1 for ; Thu, 28 Jun 2012 13:29:05 +0000 (UTC) Received: from hornbill.gentoo.org (hornbill.gentoo.org [94.100.119.163]) (using TLSv1 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id B63D11B4052 for ; Thu, 28 Jun 2012 13:29:04 +0000 (UTC) Received: from localhost.localdomain (localhost [127.0.0.1]) by hornbill.gentoo.org (Postfix) with ESMTP id 773C1E5439 for ; Thu, 28 Jun 2012 13:29:03 +0000 (UTC) From: "André Erdmann" To: gentoo-commits@lists.gentoo.org Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "André Erdmann" Message-ID: <1340889874.8d858c0d38e9425bc38136ed2e3249b7db18c71e.dywi@gentoo> Subject: [gentoo-commits] proj/R_overlay:master commit in: roverlay/depres/ X-VCS-Repository: proj/R_overlay X-VCS-Files: roverlay/depres/communication.py X-VCS-Directories: roverlay/depres/ X-VCS-Committer: dywi X-VCS-Committer-Name: André Erdmann X-VCS-Revision: 8d858c0d38e9425bc38136ed2e3249b7db18c71e X-VCS-Branch: master Date: Thu, 28 Jun 2012 13:29:03 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: quoted-printable X-Archives-Salt: 7c6f8850-ea26-447e-b5f0-dc9dafc70de7 X-Archives-Hash: 0c92cf91a74609a05a562abcbcf069bb commit: 8d858c0d38e9425bc38136ed2e3249b7db18c71e Author: Andr=C3=A9 Erdmann mailerd de> AuthorDate: Thu Jun 28 13:24:34 2012 +0000 Commit: Andr=C3=A9 Erdmann mailerd de> CommitDate: Thu Jun 28 13:24:34 2012 +0000 URL: http://git.overlays.gentoo.org/gitweb/?p=3Dproj/R_overlay.git= ;a=3Dcommit;h=3D8d858c0d depres channels: using int/long as id modified: roverlay/depres/communication.py --- roverlay/depres/communication.py | 17 +++++++++++++++-- 1 files changed, 15 insertions(+), 2 deletions(-) diff --git a/roverlay/depres/communication.py b/roverlay/depres/communica= tion.py index 943e2ca..14d6193 100644 --- a/roverlay/depres/communication.py +++ b/roverlay/depres/communication.py @@ -2,7 +2,18 @@ # Copyright 2006-2012 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 =20 -import uuid +import threading +import sys + +def channel_counter (): + lock =3D threading.Lock() + last_id =3D long ( -1 ) if sys.version_info < ( 3, ) else int ( -1 ) + + while True: + with lock: + last_id +=3D 1 + yield last_id + =20 class DependencyResolverListener ( object ): =20 @@ -48,6 +59,8 @@ class DependencyResolverListener ( object ): =20 class DependencyResolverChannel ( object ): =20 + id_generator =3D channel_counter() + def __init__ ( self, main_resolver ): """Initializes a DependencyResolverChannel which can be used to communicate with the dep resolver. @@ -60,7 +73,7 @@ class DependencyResolverChannel ( object ): #super ( DependencyResolverChannel, self ) . __init__ () # channel identifiers must be unique even when the channel has been # deleted (id does not guarantee that) - self.ident =3D uuid.uuid4() + self.ident =3D next ( DependencyResolverChannel.id_generator = ) self._depres_master =3D main_resolver # --- end of __init__ (...) --- =20