ubuntu 22.04 업데이트 후 git "sign_and_send_pubkey: no mutual signature supported" 에러 발생시

OS/linux 2022. 5. 19. 22:20
반응형

 

git pull
sign_and_send_pubkey: no mutual signature supported

 

~/.ssh/config 파일에 "PubkeyAcceptedKeyTypes +ssh-rsa" 추가

host test.test.com
 HostName test.test.com
 IdentityFile ~/.ssh/id_rsa_git
 PubkeyAcceptedKeyTypes +ssh-rsa
 User git
반응형
:

c 에서 bool을 쓰고 싶을때 #include <stdbool.h>

프로그래밍/c,c++ 2022. 5. 17. 15:30
반응형

c 에서 bool을 쓰고 싶을때 #include <stdbool.h>

 

bool val = true;

val = false;

반응형
:

pthread 예제 코드

프로그래밍/c,c++ 2022. 5. 9. 22:37
반응형

pthread 사용을 위한 기본 예제

#include <stdio.h>
#include <pthread.h>
#include <unistd.h>

static bool sIsStop = false;
static pthread_t sThreadId = 0;

static void *testThread(void *data) {
    while (true) {
        if (sIsStop) {
            break;
        }

        printf("%s[%d] TID = %d Running thread\n", __FUNCTION__, __LINE__, gettid());
        // add code

        usleep(1000 *1000);
    }

    sThreadId = 0;

    return NULL;
}

int startThread() {
    if (sThreadId == 0) {
        sIsStop = false;
        pthread_create(&sThreadId, NULL, &testThread, NULL);
    }
    else {
        printf("%s[%d] Thread is running\n", __FUNCTION__, __LINE__);
    }

    return 0;
}

int stopThread() {
    if (sThreadId != 0) {
        sIsStop = true;
        pthread_join(sThreadId, NULL);
    }
    else {
        printf("%s[%d] Thread is not running\n", __FUNCTION__, __LINE__);
    }
    return 0;
}

int main() {
    startThread();

    usleep(1000 *1000);
    printf("%s[%d] TID = %d test print\n", __FUNCTION__, __LINE__, gettid());
    usleep(1000 *1000);
    printf("%s[%d] TID = %d test print\n", __FUNCTION__, __LINE__, gettid());
    usleep(1000 *1000);
    printf("%s[%d] TID = %d test print\n", __FUNCTION__, __LINE__, gettid());

    stopThread();

    return 0;
}

 

실행 결과

$ ./a.out               
testThread[14] TID = 23131 Running thread
main[52] TID = 23130 test print
testThread[14] TID = 23131 Running thread
main[54] TID = 23130 test print
testThread[14] TID = 23131 Running thread
main[56] TID = 23130 test print
testThread[14] TID = 23131 Running thread
반응형
: