??????????????????????????
???????????? ???????[ 2015/4/8 14:02:17 ] ?????????????????? ??????? ????????
1 //???????????????μ??????
2 class Singleton
3 {
4 public:
5 //get ????
6 static Singleton * getInstance(){
7 //??????????????????????????
8 lock();
9 //?ж? null
10 if (NULL == instance) {
11 //?ж???????????????????????????????????
12 instance = new Singleton();
13 }
14 //???????????
15 unlock();
16 //?????????????????
17 return instance;
18 }
19 private:
20 //?????????????
21 int count = 0;
22 //???????????????
23 static Singleton *instance;
24 //??й?????
25 Singleton(){
26 count++;
27 cout << "???????" << count << "??????" << endl;
28 }
29 };
30 //????? instance
31 Singleton * Singleton::instance = NULL;
??????????????? ab ???????????????????????????????????????????????????????????????????????a ????????????b ?????????? a????????????????a ????????????????????a ????????????? b ?????????????????????н??????????b ???? a ??????е?????????????????????b ????????????????????????????????????????????????????????
??????????????????μ????????????
?????????У???? get ?????У???? instance??????ж???????????ж???????????????????????????????????????????????????????????????????????ж????μ????????????????????????????????????????????????????t?????????????б????????????е?????????ж??????
?????????????????????д????????????????ж?????????????????????????????????????????????????????????????
????????ж????????????????????
1 class Singleton
2 {
3 public:
4 //get ????
5 static Singleton * getInstance(){
6 //???ж???? null????? null ???????????????????????????????????
7 if (NULL == instance) {
8 //??????????????????????????
9 lock();
10 //???????ж? null
11 if (NULL == instance) {
12 //?ж???????????????????????????????????
13 instance = new Singleton();
14 }
15 //???????????
16 unlock();
17 }
18 //?????????????????
19 return instance;
20 }
21 private:
22 //?????????????
23 int count = 0;
24 //???????????????
25 static Singleton *instance;
26 //??й?????
27 Singleton(){
28 count++;
29 cout << "???????" << count << "??????" << endl;
30 }
31 };
32 //????? instance
33 Singleton * Singleton::instance = NULL;
????????????????????????????????????μ?Ч????????????????????????δ????????????????????????????????????????????????????ж????????Ч??
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???д?ò??????????????????????д?淶??α??????????????????????????????????????????????????????е?Ч?????в????г??????????????????????в?????????????в????г????????????????????????????в????е???????????????????????????????????????ж??????????????????????????????ALM(??????????????)????????????????excel????????ALM(??????????????)????????????????????????????????????????????????д????????????????????????????????????????????????????????????????????????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????