DUBLIN — The loved ones of two Bay Area homicide victims have waited decades for their date in court, but now even after the alleged killer’s arrest, that day might never come.

James Gary, co-founder and longtime deacon of the Olive Branch Missionary Baptist Church in West Oakland, has been in jail for four years awaiting trial in the 1980 killing of 46-year-old Latrelle Lindsay and the 1996 homicide of Winifred Douglas, also 46, in Vallejo. If everything had gone according to plan, he would have gone on trial last week for allegedly sexually assaulting and strangling his mother in law, Lindsay, inside her Union City home.

But now Gary’s defense attorney has openly cast a doubt on Gary’s mental competence for trial, suspending the court proceedings indefinitely while Gary is evaluated by mental health professionals. Even if he’s found competent, his lawyer, David Briggs, could challenge the finding, forcing a separate trial where his ability to understand and assist in his legal defense will be evaluated.

On Friday, a judge is set to review reports from psychiatric interviews of Gary, whose medical records have been placed under seal. His jury trial hasn’t been given a new date until this process is completed. But Gary, who turned 80 in June, should remain incarcerated either in jail or at a state hospital while attorneys debate whether he’s ready.

If found mentally incompetent, Gary could be transferred to a state hospital where doctors will try and “restore” his competency. If he’s deemed ready for trial, he’ll go before a jury on Lindsay’s killing first, before the court process starts for Douglas.

Court records say that two “alienists” examined Gary before July 13, when his attorney formally declared a doubt to Gary’s mental competency. Two more were appointed at the July hearing.

Gary, a Fairfield resident, was linked by DNA to both crimes, after a wild series of events that started when a homeless Fairfield woman accused him of raping her, recanted, then made additional subsequent allegations against him. In one of the alleged sexual assaults, committed on the 1300 block of Texas Street, police collected Gary’s DNA, which matched to both homicide scenes — but they still did not know to whom it belonged.

Finally, after a second alleged sexual assault in Dixon, the woman named Gary as her attacker and police collected his DNA by tricking him into taking a breathalyzer test during a traffic stop, court records show.

Lindsay was attacked and strangled inside her Union City home in July 1980. Her body was discovered when her daughter — Gary’s longtime wife, now ex-spouse — and a friend went to the home to check on her. Sixteen years after the homicide, Gary allegedly picked up Douglas, an unhoused sex worker, from an area she was known to stay at in Berkeley. Her body was discovered off of a freeway in Vallejo and police later found blood at the Berkeley encampment, court records show.

Gary has been charged with one count of murder in Alameda County, and one count in Solano County. The prosecutions are happening in the order the homicides occurred in, according to court records.

For now, Gary remains at Santa Rita Jail in Dublin on a no-bail hold.