[{"id":3981,"web_url":"https://patchwork.libcamera.org/comment/3981/","msgid":"<20200306231431.GA2975348@oden.dyn.berto.se>","date":"2020-03-06T23:14:31","subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Don't\n\tuse std::atomic specialization","submitter":{"id":5,"url":"https://patchwork.libcamera.org/api/people/5/","name":"Niklas Söderlund","email":"niklas.soderlund@ragnatech.se"},"content":"Hi Laurent,\n\nThanks for your fix, sorry for breaking it in the first place.\n\nOn 2020-03-07 01:10:50 +0200, Laurent Pinchart wrote:\n> The std::atomic_uint64_t specialization was missing from C++14, and only\n> added to C++17 (see LWG 2441). It was treated as a Defect Report and\n> backported to earlier C++ standards by gcc and clang, but is missing\n> from libstdc++ shipped with gcc 5 and gcc 6. Fix the compilation error\n> by using std::atomic<uint64_t> instead.\n> \n> Fixes: 4e0d1eca10b7 (\"libcamera: V4L2BufferCache: Improve cache eviction strategy\")\n> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>\n\nReviewed-by: Niklas Söderlund <niklas.soderlund@ragnatech.se>\n\n> ---\n>  src/libcamera/include/v4l2_videodevice.h | 3 ++-\n>  1 file changed, 2 insertions(+), 1 deletion(-)\n> \n> diff --git a/src/libcamera/include/v4l2_videodevice.h b/src/libcamera/include/v4l2_videodevice.h\n> index 04802012d531..d051c9060f09 100644\n> --- a/src/libcamera/include/v4l2_videodevice.h\n> +++ b/src/libcamera/include/v4l2_videodevice.h\n> @@ -9,6 +9,7 @@\n>  \n>  #include <atomic>\n>  #include <memory>\n> +#include <stdint.h>\n>  #include <string>\n>  #include <vector>\n>  \n> @@ -142,7 +143,7 @@ private:\n>  \t\tstd::vector<Plane> planes_;\n>  \t};\n>  \n> -\tstd::atomic_uint64_t lastUsedCounter_;\n> +\tstd::atomic<uint64_t> lastUsedCounter_;\n>  \tstd::vector<Entry> cache_;\n>  \t/* \\todo Expose the miss counter through an instrumentation API. */\n>  \tunsigned int missCounter_;\n> -- \n> Regards,\n> \n> Laurent Pinchart\n> \n> _______________________________________________\n> libcamera-devel mailing list\n> libcamera-devel@lists.libcamera.org\n> https://lists.libcamera.org/listinfo/libcamera-devel","headers":{"Return-Path":"<niklas.soderlund@ragnatech.se>","Received":["from mail-lj1-x244.google.com (mail-lj1-x244.google.com\n\t[IPv6:2a00:1450:4864:20::244])\n\tby lancelot.ideasonboard.com (Postfix) with ESMTPS id CB22F60427\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tSat,  7 Mar 2020 00:14:33 +0100 (CET)","by mail-lj1-x244.google.com with SMTP id r7so3922392ljp.10\n\tfor <libcamera-devel@lists.libcamera.org>;\n\tFri, 06 Mar 2020 15:14:33 -0800 (PST)","from localhost (h-200-138.A463.priv.bahnhof.se. [176.10.200.138])\n\tby smtp.gmail.com with ESMTPSA id\n\te8sm40824ljj.67.2020.03.06.15.14.32\n\t(version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256);\n\tFri, 06 Mar 2020 15:14:32 -0800 (PST)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=ragnatech-se.20150623.gappssmtp.com; s=20150623;\n\th=date:from:to:cc:subject:message-id:references:mime-version\n\t:content-disposition:content-transfer-encoding:in-reply-to;\n\tbh=Xl159aQgFN/16cuBgvHlcoS3k2A9RUzoarrtpWw53hE=;\n\tb=dQrkxdogfdRegJYkR8JTBGys4fXXp84zf+mUIOLixW/YEHqThrOtTzpfdR/qgGrUgD\n\tvhbeIe2O1uSkVnYoSFVavASpQZqC/zXs22vN2rkGbWZb8ht7tj0lyIdBNxfhatdbKhdl\n\t2QfjiN3fm7+n9gUqxxQlaNVGXQmPxxoHEQwb1efgp9zrCkuUZWW9BWekY352LRvNg2GB\n\tC3JzGTGyj7kz/xI3fdqWxakz0RR7jjo5TvL8Q7Udl60h41U2Pyf+c3TB5UwQyVMVUZtV\n\tGfJ42wzJgAskCOO+JyXjlw1w7Q61HUJjxLg+4je/59f+siF0smOm7Qz+LKNkizQhtUVg\n\t0Uww==","X-Google-DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed;\n\td=1e100.net; s=20161025;\n\th=x-gm-message-state:date:from:to:cc:subject:message-id:references\n\t:mime-version:content-disposition:content-transfer-encoding\n\t:in-reply-to;\n\tbh=Xl159aQgFN/16cuBgvHlcoS3k2A9RUzoarrtpWw53hE=;\n\tb=M6kIZWSi2ZnGu7HDqGkGbnyovTBoDDxZSwUqHOIeE5P4Zqy4svLe0e47idGdrwMG1q\n\tCKAp4WZtY7JxddUtLHNgXbpQiS4ck6ezqG0AnYgU16o87aUdMctV9/BSBVMljOj1nhRc\n\tZ50mByFNUvzdyCQhHeL8rVi7gO/qy73F2zbUIpyJyz3TW9UfwFQQAf5GGdqK3b9jn8FM\n\tw0HPT0T2UIftNhfxcDIMyBAZGEpNmDvLn9O2Vi2prrWpbRA42i69yQhvMrNPjAwXZ7Hs\n\tK1LMs5FjdeHnQbqKA0nHPkQaZVZUuocrPnM36iNd5q6MKOgXCoRYSHdtEVWQ0txm/trY\n\t37aw==","X-Gm-Message-State":"ANhLgQ28tfzYKLaB2z5XQFisIKmVTKFrLOuULjbIdpyygX3aSdZsmW4m\n\tFA14Iyvbd6hBMDaEvRSHHAINQsWrF70=","X-Google-Smtp-Source":"ADFU+vslZ1Xd5B/zKNvWudOWiEGRYmeRscgyKg71mq1dxUJS+SwaskclVSjvKcGMvDQFzezZm7khZw==","X-Received":"by 2002:a2e:94c8:: with SMTP id r8mr3403702ljh.28.1583536472985; \n\tFri, 06 Mar 2020 15:14:32 -0800 (PST)","Date":"Sat, 7 Mar 2020 00:14:31 +0100","From":"Niklas =?iso-8859-1?q?S=F6derlund?= <niklas.soderlund@ragnatech.se>","To":"Laurent Pinchart <laurent.pinchart@ideasonboard.com>","Cc":"libcamera-devel@lists.libcamera.org","Message-ID":"<20200306231431.GA2975348@oden.dyn.berto.se>","References":"<20200306231050.7986-1-laurent.pinchart@ideasonboard.com>","MIME-Version":"1.0","Content-Type":"text/plain; charset=iso-8859-1","Content-Disposition":"inline","Content-Transfer-Encoding":"8bit","In-Reply-To":"<20200306231050.7986-1-laurent.pinchart@ideasonboard.com>","Subject":"Re: [libcamera-devel] [PATCH] libcamera: v4l2_videodevice: Don't\n\tuse std::atomic specialization","X-BeenThere":"libcamera-devel@lists.libcamera.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<libcamera-devel.lists.libcamera.org>","List-Unsubscribe":"<https://lists.libcamera.org/options/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=unsubscribe>","List-Archive":"<https://lists.libcamera.org/pipermail/libcamera-devel/>","List-Post":"<mailto:libcamera-devel@lists.libcamera.org>","List-Help":"<mailto:libcamera-devel-request@lists.libcamera.org?subject=help>","List-Subscribe":"<https://lists.libcamera.org/listinfo/libcamera-devel>,\n\t<mailto:libcamera-devel-request@lists.libcamera.org?subject=subscribe>","X-List-Received-Date":"Fri, 06 Mar 2020 23:14:34 -0000"}}]