ç®ç ãvolatileã£ã¦ä½ï¼ãã¨ãã質åããããèªåã®ç解ãææ§ã ã£ãã®ã§å¾©ç¿ãã¦ã¿ãã åå¼·å 容 volatileã£ã¦ï¼ ä½ã®æå³ãããã®ï¼ ã³ã³ãã¤ã©ã®æé©å(ç½®ãæã)ãææ¢ãã ã³ã³ãã¤ã©ã®æé©å(ãªãªã¼ãã¼)ãææ¢ãã ã¹ã¬ãããå¤ãåç §ããéã«ãå¿ ãææ°ã®å¤ãè¦ãããã«ãã volatileã£ã¦ï¼ 修飾åã§ãã次ã®ããã«ãã£ã¼ã«ãã«å¯¾ãã¦ä»ãã¾ãã public class Hoge { public volatile int num; } ä½ã®æå³ãããã®ï¼ ã¼ãã¯æ¬¡ã®ããã«ç解ãã¦ãã¾ãããã¾ã èªä¿¡ã¯ããã¾ããã ã³ã³ãã¤ã©ã®æé©å(ç½®ãæã)ãææ¢ãã ã³ã³ãã¤ã©ã®æé©å(ãªãªã¼ãã¼)ãææ¢ãã ã¹ã¬ãããå¤ãåç §ããéã«ãå¿ ãææ°ã®å¤ãè¦ãããã«ãã Javaã§ã¯3ã¤ç®ã®èª¬æã°ããè¦ãã®ã§ãããããã¯çµæã¨ãã¦ä»ã®ã対å¿ããããããªã®ããªï¼ ã¾ã ããåãã£ã¦ãã¾ãã
{{#tags}}- {{label}}
{{/tags}}