From dev-return-51099-archive-asf-public=cust-asf.ponee.io@thrift.apache.org Tue Jan 23 21:34:04 2018 Return-Path: X-Original-To: archive-asf-public@eu.ponee.io Delivered-To: archive-asf-public@eu.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by mx-eu-01.ponee.io (Postfix) with ESMTP id CCD7B180621 for ; Tue, 23 Jan 2018 21:34:04 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id BCC0E160C24; Tue, 23 Jan 2018 20:34:04 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 0F369160C3A for ; Tue, 23 Jan 2018 21:34:03 +0100 (CET) Received: (qmail 16766 invoked by uid 500); 23 Jan 2018 20:34:03 -0000 Mailing-List: contact dev-help@thrift.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@thrift.apache.org Delivered-To: mailing list dev@thrift.apache.org Received: (qmail 16755 invoked by uid 99); 23 Jan 2018 20:34:03 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 23 Jan 2018 20:34:03 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 91A73C183C for ; Tue, 23 Jan 2018 20:34:02 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -108.711 X-Spam-Level: X-Spam-Status: No, score=-108.711 tagged_above=-999 required=6.31 tests=[ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_LOW=-0.7, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01, USER_IN_DEF_SPF_WL=-7.5, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id pN5bp4dZMrz4 for ; Tue, 23 Jan 2018 20:34:01 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with ESMTP id 46A8E5F2C2 for ; Tue, 23 Jan 2018 20:34:01 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7C57CE0F66 for ; Tue, 23 Jan 2018 20:34:00 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id 12B2325C61 for ; Tue, 23 Jan 2018 20:34:00 +0000 (UTC) Date: Tue, 23 Jan 2018 20:34:00 +0000 (UTC) From: "Jens Geyer (JIRA)" To: dev@thrift.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (THRIFT-4468) Make the class TGUIConsole thread-safe MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 [ https://issues.apache.org/jira/browse/THRIFT-4468?page=3Dcom.atlassia= n.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=3D163= 36336#comment-16336336 ]=20 Jens Geyer commented on THRIFT-4468: ------------------------------------ I don't see this patch as part of the Thrift library. The entire Console co= nstruct is basically only a helper that was introduced as part of the initi= al development. Since the model was the C# library, the original author int= roduced that class, very likely to reduce dependencies. The implementation = is rather raw (read: shitty), and - in the case of the real console it is n= ot safe against concurrent accesses. If asked, I would rather throw it out = instead of polishing it and adding features. We are dealing with RPC here, = not with providing cool console output stuff. Long story short: I'm against it. -1 > Make the class TGUIConsole thread-safe > -------------------------------------- > > Key: THRIFT-4468 > URL: https://issues.apache.org/jira/browse/THRIFT-4468 > Project: Thrift > Issue Type: Improvement > Components: Delphi - Library > Affects Versions: 0.11.0 > Reporter: Anton Shchyrov > Priority: Major > > In Delphi all methods=C2=A0that refer to VCL=C2=A0should do it only from = main thread. But class=C2=A0TGUIConsole=C2=A0despite the name=C2=A0does not= contain any synchronization methods. > My suggestion is to rename this class to TStringsConsole, make method=C2= =A0InternalWrite virtual and make new class TGUIConsole=C2=A0inherits from= =C2=A0TStringsConsole > {{ TGUIConsole =3D class( TStringsConsole )}} > {{ protected}} > {{=C2=A0 procedure InternalWrite(const S: string; bWriteLine: Boolean); o= verride;}} > {{ end;}} > {{{ TGUIConsole }}} > {{procedure TGUIConsole.InternalWrite(const S: string; bWriteLine: Boolea= n);}} > {{begin}} > {{=C2=A0 if TThread.CurrentThread.ThreadID <> MainThreadID then begin}} > {{=C2=A0 =C2=A0 TThread.Synchronize(nil, procedure}} > {{=C2=A0 =C2=A0 =C2=A0 begin}} > {{=C2=A0 =C2=A0 =C2=A0 =C2=A0 inherited InternalWrite(S, bWriteLine);}} > {{=C2=A0 =C2=A0 =C2=A0 end}} > {{=C2=A0 =C2=A0 );}} > {{=C2=A0 end else}} > {{=C2=A0 =C2=A0 inherited InternalWrite(S, bWriteLine);}} > {{end;}} > =C2=A0 -- This message was sent by Atlassian JIRA (v7.6.3#76005)