Message ID | 20190307072057.8150-1-elena.ufimtseva@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5670614DE for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 7 Mar 2019 07:22:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 356EC2E7CE for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 7 Mar 2019 07:22:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 262442E84F; Thu, 7 Mar 2019 07:22:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.7 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id C717D2E7CE for <patchwork-qemu-devel@patchwork.kernel.org>; Thu, 7 Mar 2019 07:22:33 +0000 (UTC) Received: from localhost ([127.0.0.1]:46563 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org>) id 1h1nMP-0002eo-3P for patchwork-qemu-devel@patchwork.kernel.org; Thu, 07 Mar 2019 02:22:33 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59455) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from <elena.ufimtseva@oracle.com>) id 1h1nKz-0001Y9-Lc for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:21:06 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from <elena.ufimtseva@oracle.com>) id 1h1nKy-0004Dl-Tf for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:21:05 -0500 Received: from userp2120.oracle.com ([156.151.31.85]:54846) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from <elena.ufimtseva@oracle.com>) id 1h1nKy-0004DJ-KQ for qemu-devel@nongnu.org; Thu, 07 Mar 2019 02:21:04 -0500 Received: from pps.filterd (userp2120.oracle.com [127.0.0.1]) by userp2120.oracle.com (8.16.0.27/8.16.0.27) with SMTP id x277JWkv037984; Thu, 7 Mar 2019 07:21:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id; s=corp-2018-07-02; bh=a/u1HZ4JrC7CQ1VNDRlH0Nm6D1tRq2GuVmhJVTmBQas=; b=u1FeCRMIa3szBD6d6O2BLzE5RfyYb0KSFS9Fj9x3yPit5P0l5UyJA4Cs1fPcB/a6h0CB w55l/VdoMVGe25TaieA6p1G965VxYqFuTsYMNO2+PD8/T213YzSILgTTIc00JewXorUn j3TlZKm4IDsmO3bOFWf9YGaOd8OuB3FxDHTpnIg5t1OcxggRWDZc8XLgVfhYb1lv8rCD uQEWH3EgiScvmvMlRSUFzxni6tuSL2bZYx43X9OW9T7SqSz9j3dKpusZE61iYyV/sCwE NlALj9j7h3IbtyBkz21b8c/iekNP2UrKJZLP53zSkPPgXoSLwPcelhQ9a4LmxMUUol6b Kg== Received: from userv0021.oracle.com (userv0021.oracle.com [156.151.31.71]) by userp2120.oracle.com with ESMTP id 2qyjfrr59y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 07 Mar 2019 07:21:01 +0000 Received: from aserv0122.oracle.com (aserv0122.oracle.com [141.146.126.236]) by userv0021.oracle.com (8.14.4/8.14.4) with ESMTP id x277L0Lw003049 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Mar 2019 07:21:01 GMT Received: from abhmp0003.oracle.com (abhmp0003.oracle.com [141.146.116.9]) by aserv0122.oracle.com (8.14.4/8.14.4) with ESMTP id x277L0uU023771; Thu, 7 Mar 2019 07:21:00 GMT Received: from heatpipe.hsd1.ca.comcast.net (/73.170.27.202) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 06 Mar 2019 23:21:00 -0800 From: elena.ufimtseva@oracle.com To: qemu-devel@nongnu.org Date: Wed, 6 Mar 2019 23:20:57 -0800 Message-Id: <20190307072057.8150-1-elena.ufimtseva@oracle.com> X-Mailer: git-send-email 2.17.1 X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9187 signatures=668685 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1903070053 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 156.151.31.85 Subject: [Qemu-devel] [multiprocess RFC PATCH 02/37] multi-process: util: Add qemu_thread_cancel() to cancel running thread X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: <qemu-devel.nongnu.org> List-Unsubscribe: <https://lists.nongnu.org/mailman/options/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe> List-Archive: <http://lists.nongnu.org/archive/html/qemu-devel/> List-Post: <mailto:qemu-devel@nongnu.org> List-Help: <mailto:qemu-devel-request@nongnu.org?subject=help> List-Subscribe: <https://lists.nongnu.org/mailman/listinfo/qemu-devel>, <mailto:qemu-devel-request@nongnu.org?subject=subscribe> Cc: elena.ufimtseva@oracle.com, john.g.johnson@oracle.com, sstabellini@kernel.org, jag.raman@oracle.com, konrad.wilk@oracle.com, ross.lagerwall@citrix.com, liran.alon@oracle.com, stefanha@redhat.com, pbonzini@redhat.com, kanth.ghatraju@oracle.com Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" <qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
Initial support of multi-process qemu
|
expand
|
diff --git a/include/qemu/thread.h b/include/qemu/thread.h index 55d83a9..78791be 100644 --- a/include/qemu/thread.h +++ b/include/qemu/thread.h @@ -156,6 +156,7 @@ void qemu_thread_create(QemuThread *thread, const char *name, void *(*start_routine)(void *), void *arg, int mode); void *qemu_thread_join(QemuThread *thread); +void qemu_thread_cancel(QemuThread *thread); void qemu_thread_get_self(QemuThread *thread); bool qemu_thread_is_self(QemuThread *thread); void qemu_thread_exit(void *retval); diff --git a/util/qemu-thread-posix.c b/util/qemu-thread-posix.c index 1bf5e65..7c89071 100644 --- a/util/qemu-thread-posix.c +++ b/util/qemu-thread-posix.c @@ -573,3 +573,13 @@ void *qemu_thread_join(QemuThread *thread) } return ret; } + +void qemu_thread_cancel(QemuThread *thread) +{ + int err; + + err = pthread_cancel(thread->thread); + if (err) { + error_exit(err, __func__); + } +}